コード例 #1
0
 protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
     // only happens if configuration is bad
     if (arguments != null)
     {
         foreach (String argument in arguments)
         {
             commandLine.AppendSwitch(argument);
         }
     }
 }
コード例 #2
0
 protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
     commandLine.AppendSwitch("disable-gpu", "1");
     commandLine.AppendSwitch("off-screen-rendering-enabled", "1");
 }
コード例 #3
0
        protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
        {
            // only happens if configuration is bad
            if (arguments != null)
            {
                foreach (String argument in arguments)
                {
                    string normalizedArgument = argument;
                    if (argument.StartsWith("--"))
                    {
                        if (argument.Length > 2)
                        {
                            normalizedArgument = argument.Substring(2);
                        }
                        else
                        {
                            Console.WriteLine(
                                "BrowserApp::OnBeforeCommandLineProcessing bad argument {0}",
                                argument);
                            continue;
                        }
                    }

                    int argSplitIndex = normalizedArgument.IndexOf('=');
                    if (argSplitIndex >= 0)
                    {
                        string name = normalizedArgument.Substring(0, argSplitIndex);
                        string value = normalizedArgument.Substring(argSplitIndex + 1);

                        if (value.StartsWith("\"") && value.EndsWith("\""))
                        {
                            value = value.Substring(1, value.Length - 2);
                        }

                        commandLine.AppendSwitch(name, value);
                    }
                    else
                    {
                        commandLine.AppendSwitch(normalizedArgument);
                    }
                }
            }

            // If these were not manually specified then
            // try to add pepflashplayer.dll
            if (!commandLine.HasSwitch("ppapi-out-of-process") &&
                !commandLine.HasSwitch("register-pepper-plugins"))
            {
                string flashPluginPath = Path.Combine(
                    CLRBrowserSourcePlugin.AssemblyDirectory,
                    "CLRBrowserSourcePlugin", "pepflashplayer.dll");

                if (File.Exists(flashPluginPath))
                {
                    commandLine.AppendSwitch("ppapi-out-of-process");

                    string flashPluginValue = flashPluginPath +
                        ";application/x-shockwave-flash";

                    commandLine.AppendSwitch("register-pepper-plugins",
                        flashPluginValue);
                }
            }
        }