public void Launch(ResourceCache resourceCache, PluginManager pluginManager) { string storagePath = App.StoragePath; BrowserCache.RefreshTimer(); CefSharpSettings.WcfEnabled = false; CefSharpSettings.SubprocessExitIfParentProcessClosed = false; CefSettings settings = new CefSettings { UserAgent = BrowserUtils.UserAgentChrome, BrowserSubprocessPath = Path.Combine(App.ProgramPath, BrandName + ".Browser.exe"), CachePath = storagePath, UserDataPath = Path.Combine(storagePath, CefDataFolder), LogFile = Path.Combine(storagePath, ConsoleLogFile), #if !DEBUG LogSeverity = Arguments.HasFlag(Arguments.ArgLogging) ? LogSeverity.Info : LogSeverity.Disable #endif }; CefSchemeHandlerFactory.Register(settings, new TweetDuckSchemeHandler(resourceCache)); CefSchemeHandlerFactory.Register(settings, new PluginSchemeHandler(resourceCache, pluginManager)); CefUtils.ParseCommandLineArguments(Config.User.CustomCefArgs).ToDictionary(settings.CefCommandLineArgs); BrowserUtils.SetupCefArgs(settings.CefCommandLineArgs); Cef.Initialize(settings, false, new BrowserProcessHandler()); Win.Application.ApplicationExit += (sender, args) => ExitCleanup(); var updateCheckClient = new UpdateCheckClient(Path.Combine(storagePath, InstallerFolder)); var mainForm = new FormBrowser(resourceCache, pluginManager, updateCheckClient, lockManager.WindowRestoreMessage); Win.Application.Run(mainForm); if (mainForm.UpdateInstaller != null) { ExitCleanup(); if (mainForm.UpdateInstaller.Launch()) { Win.Application.Exit(); } else { RestartWithArgsInternal(Arguments.GetCurrentClean()); } } }
private void btnApply_Click(object sender, EventArgs e) { if (CefArgs == initialArgs) { DialogResult = DialogResult.Cancel; Close(); return; } int count = CefUtils.ParseCommandLineArguments(CefArgs).Count; string prompt = count == 0 && !string.IsNullOrWhiteSpace(initialArgs) ? "All current arguments will be removed. Continue?" : count + (count == 1 ? " argument was" : " arguments were") + " detected. Continue?"; if (FormMessage.Question("Confirm CEF Arguments", prompt, FormMessage.OK, FormMessage.Cancel)) { DialogResult = DialogResult.OK; Close(); } }