Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 field_trial_states); | 512 field_trial_states); |
| 513 } | 513 } |
| 514 | 514 |
| 515 BrowserChildProcessHost::SetCrashReporterCommandLine(command_line); | 515 BrowserChildProcessHost::SetCrashReporterCommandLine(command_line); |
| 516 | 516 |
| 517 FilePath user_data_dir = | 517 FilePath user_data_dir = |
| 518 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 518 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
| 519 if (!user_data_dir.empty()) | 519 if (!user_data_dir.empty()) |
| 520 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 520 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 521 #if defined(OS_CHROMEOS) | 521 #if defined(OS_CHROMEOS) |
| 522 const std::string& profile = | 522 const std::string& login_profile = |
| 523 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); | 523 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); |
| 524 if (!profile.empty()) | 524 if (!login_profile.empty()) |
| 525 command_line->AppendSwitchASCII(switches::kLoginProfile, profile); | 525 command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); |
| 526 #endif | 526 #endif |
| 527 | |
| 528 PrefService* prefs = profile()->GetPrefs(); | |
| 529 // Currently this pref is only registered if applied via a policy. | |
| 530 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && | |
| 531 prefs->GetBoolean(prefs::kDisable3DAPIs)) { | |
| 532 // Turn this policy into a command line switch. | |
| 533 command_line->AppendSwitch(switches::kDisable3DAPIs); | |
| 534 } | |
| 527 } | 535 } |
| 528 | 536 |
| 529 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( | 537 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( |
| 530 const CommandLine& browser_cmd, | 538 const CommandLine& browser_cmd, |
| 531 CommandLine* renderer_cmd) const { | 539 CommandLine* renderer_cmd) const { |
| 532 // Propagate the following switches to the renderer command line (along | 540 // Propagate the following switches to the renderer command line (along |
| 533 // with any associated values) if present in the browser command line. | 541 // with any associated values) if present in the browser command line. |
| 534 static const char* const kSwitchNames[] = { | 542 static const char* const kSwitchNames[] = { |
| 535 switches::kRendererAssertTest, | 543 switches::kRendererAssertTest, |
| 536 #if !defined(OFFICIAL_BUILD) | 544 #if !defined(OFFICIAL_BUILD) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 switches::kDisableOutdatedPlugins, | 631 switches::kDisableOutdatedPlugins, |
| 624 switches::kEnableRemoting, | 632 switches::kEnableRemoting, |
| 625 switches::kEnableClickToPlay, | 633 switches::kEnableClickToPlay, |
| 626 switches::kEnableResourceContentSettings, | 634 switches::kEnableResourceContentSettings, |
| 627 switches::kPrelaunchGpuProcess, | 635 switches::kPrelaunchGpuProcess, |
| 628 switches::kEnableAcceleratedDecoding, | 636 switches::kEnableAcceleratedDecoding, |
| 629 switches::kDisableFileSystem, | 637 switches::kDisableFileSystem, |
| 630 switches::kPpapiOutOfProcess, | 638 switches::kPpapiOutOfProcess, |
| 631 switches::kEnablePrintPreview, | 639 switches::kEnablePrintPreview, |
| 632 switches::kEnableClientSidePhishingDetection, | 640 switches::kEnableClientSidePhishingDetection, |
| 633 switches::kEnableCrxlessWebApps | 641 switches::kEnableCrxlessWebApps |
|
Ken Russell (switch to Gerrit)
2011/01/08 00:10:43
The passing down of --disable-3d-apis command line
| |
| 634 }; | 642 }; |
| 635 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 643 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
| 636 arraysize(kSwitchNames)); | 644 arraysize(kSwitchNames)); |
| 637 | 645 |
| 638 // Disable databases in incognito mode. | 646 // Disable databases in incognito mode. |
| 639 if (profile()->IsOffTheRecord() && | 647 if (profile()->IsOffTheRecord() && |
| 640 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 648 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
| 641 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 649 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
| 642 } | 650 } |
| 643 } | 651 } |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1171 IPC::InvalidPlatformFileForTransit(), | 1179 IPC::InvalidPlatformFileForTransit(), |
| 1172 std::vector<std::string>(), | 1180 std::vector<std::string>(), |
| 1173 std::string(), | 1181 std::string(), |
| 1174 false)); | 1182 false)); |
| 1175 } | 1183 } |
| 1176 } | 1184 } |
| 1177 | 1185 |
| 1178 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1186 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
| 1179 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1187 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
| 1180 } | 1188 } |
| OLD | NEW |