コード例 #1
0
ファイル: Initializer.cs プロジェクト: rpc-bindings/cefglue
 protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
 {
     //commandLine.AppendArgument("--renderer-startup-dialog");
     //commandLine.AppendArgument("--gpu-startup-dialog");
     commandLine.AppendArgument("--disable-gpu");
     commandLine.AppendArgument("--disable-gpu-compositing");
 }
コード例 #2
0
 protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
 {
     if (commandLine.GetSwitchValue("type").StartsWith("render"))
     {
         if (_disableSpellChecking)
         {
             commandLine.AppendArgument("--disable-spell-checking");
         }
         else if (!string.IsNullOrEmpty(_spellCheckLanguage) && !_spellCheckLanguage.Equals("en-US"))
         {
             commandLine.AppendArgument(string.Format("--override-spell-check-lang={0}", _spellCheckLanguage));
         }
     }
     base.OnBeforeChildProcessLaunch(commandLine);
 }
コード例 #3
0
ファイル: ProcessHandler.cs プロジェクト: Fsamot/HtmlUi
        /// <summary>
        /// Called before child process launch.
        /// </summary>
        /// <param name="commandLine">The command line.</param>
        protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
        {
            if (commandLine == null)
            {
                throw new ArgumentNullException("commandLine");
            }

            // .NET in Windows treat assemblies as native images, so no any magic required.
            // Mono on any platform usually located far away from entry assembly, so we want prepare command line to call it correctly.
            if (Type.GetType("Mono.Runtime") != null)
            {
                if (!commandLine.HasSwitch("cefglue"))
                {
                    var path = PathUtility.Application;
                    commandLine.SetProgram(path);

                    var mono = CefRuntime.Platform == CefRuntimePlatform.Linux ? "/usr/bin/mono" : @"C:\Program Files\Mono-2.10.8\bin\monow.exe";
                    commandLine.PrependArgument(mono);

                    commandLine.AppendSwitch("cefglue", "w");
                }
            }

            if (!BaseMainApplication.Current.EnableD3D11 && !commandLine.GetArguments().Contains(Argument.DisableD3D11.Value))
            {
                commandLine.AppendArgument(Argument.DisableD3D11.Value);
            }
        }
コード例 #4
0
        protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
        {
            commandLine.AppendSwitch("default-encoding", "utf-8");
            commandLine.AppendArgument("--allow-file-access-from-files");
            commandLine.AppendArgument("--allow-universal-access-from-files");
            commandLine.AppendArgument("--disable-web-security");
            commandLine.AppendArgument("--ignore-certificate-errors");


            WinFormium.Runtime.ChromiumEnvironment.CommandLineConfigurations?.Invoke(commandLine);

            commandLine.AppendSwitch("--libcef-dir-path", WinFormium.Runtime.ChromiumEnvironment.LibCefDir);
            commandLine.AppendSwitch("--host-process-id", System.Diagnostics.Process.GetCurrentProcess().Id.ToString());

            if (WinFormium.Runtime.IsDebuggingMode)
            {
                logger.Debug("On CefGlue child process launch arguments:");
                logger.Verbose(commandLine.ToString());
            }
        }
コード例 #5
0
        /// <summary>
        /// The on before command line processing.
        /// </summary>
        /// <param name="processType">
        /// The process type.
        /// </param>
        /// <param name="commandLine">
        /// The command line.
        /// </param>
        protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
        {
            // Get all custom command line argument switches
            if (_config?.CommandLineArgs != null)
            {
                foreach (var commandArg in _config.CommandLineArgs)
                {
                    commandLine.AppendSwitch(commandArg.Item1 ?? string.Empty, commandArg.Item2);
                }
            }

            if (_config?.CommandLineOptions != null)
            {
                foreach (var commmandOption in _config?.CommandLineOptions)
                {
                    commandLine.AppendSwitch(commmandOption ?? string.Empty);
                }
            }

            // Currently on linux platform location of locales and pack files are determined
            // incorrectly (relative to main module instead of libcef.so module).
            // Once issue http://code.google.com/p/chromiumembedded/issues/detail?id=668 will be resolved
            // this code can be removed.
            if (CefRuntime.Platform == CefRuntimePlatform.Linux)
            {
                if (string.IsNullOrEmpty(processType) || processType.Contains("zygote"))
                {
                    commandLine.AppendSwitch("no-zygote");
                }


                commandLine.AppendArgument("--disable-gpu");
                commandLine.AppendArgument("--disable-software-rasterizer");

                commandLine.AppendSwitch("disable-gpu", "1");
                commandLine.AppendSwitch("disable-software-rasterizer", "1");

                commandLine.AppendSwitch("resources-dir-path", _config.AppExeLocation);
                commandLine.AppendSwitch("locales-dir-path", Path.Combine(_config.AppExeLocation, "locales"));
            }
        }
コード例 #6
0
        /// <summary>
        /// Called before child process launch.
        /// </summary>
        /// <param name="commandLine">The command line.</param>
        protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
        {
            if (commandLine == null)
            {
                throw new ArgumentNullException("commandLine");
            }

            if (!Application.Current.D3D11Enabled && !commandLine.GetArguments().Contains(Argument.DisableD3D11.Value))
            {
                commandLine.AppendArgument(Argument.DisableD3D11.Value);
            }
        }
コード例 #7
0
ファイル: App.cs プロジェクト: Fsamot/HtmlUi
        /// <summary>
        /// Called before command line processing.
        /// </summary>
        /// <param name="processType">Type of the process.</param>
        /// <param name="commandLine">The command line.</param>
        protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
        {
            if (commandLine == null)
            {
                throw new ArgumentNullException("commandLine");
            }

            if (!commandLine.HasSwitch("resources-dir-path"))
            {
                commandLine.AppendSwitch("resources-dir-path", PathUtility.WorkingDirectory);
            }

            if (!commandLine.HasSwitch("locales-dir-path"))
            {
                commandLine.AppendSwitch("locales-dir-path", Path.Combine(PathUtility.WorkingDirectory, "locales"));
            }

            if (!BaseMainApplication.Current.EnableD3D11 && !commandLine.GetArguments().Contains(Argument.DisableD3D11.Value))
            {
                commandLine.AppendArgument(Argument.DisableD3D11.Value);
            }
        }