/// <summary> /// Run internal. /// </summary> protected override void RunInternal() { CefRuntime.Load(); var mainArgs = new CefMainArgs(EnvironmentUtility.GetCommandLineArgs()); var app = new App(); app.BrowserCreated += (s, e) => { CefBrowser = e.CefBrowser; }; CefRuntime.ExecuteProcess(mainArgs, app, IntPtr.Zero); }
/// <summary> /// Initializes the cef on current thread. /// </summary> private void InitializeCefOnCurrentThread() { Logger.Info("Initializing CEF."); CefRuntime.Load(); var cefSettings = new CefSettings { MultiThreadedMessageLoop = IsMultiThreadedMessageLoop, SingleProcess = false, LogSeverity = CefLogSeverity.Warning, LogFile = LogsDirectoryPath + "/cef.log", CachePath = CacheDirectoryPath, ResourcesDirPath = PathUtility.WorkingDirectory, LocalesDirPath = PathUtility.WorkingDirectory + "/locales", RemoteDebuggingPort = RemoteDebuggingPort, NoSandbox = true, CommandLineArgsDisabled = !CommandLineArgsEnabled }; // arguments var arguments = new List <string>(); if (CommandLineArgsEnabled) { arguments.AddRange(EnvironmentUtility.GetCommandLineArgs()); } if (!D3D11Enabled && !arguments.Contains(Argument.DisableD3D11.Value)) { arguments.Add(Argument.DisableD3D11.Value); } // initialize var mainArgs = new CefMainArgs(arguments.ToArray()); var app = new App(); app.ContextInitialized += (s, args) => { OnInitialize(); }; CefRuntime.Initialize(mainArgs, cefSettings, app, IntPtr.Zero); Logger.Info("CEF initialized."); }