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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 FilePath user_data_dir = | 584 FilePath user_data_dir = |
585 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 585 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
586 if (!user_data_dir.empty()) | 586 if (!user_data_dir.empty()) |
587 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 587 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
588 #if defined(OS_CHROMEOS) | 588 #if defined(OS_CHROMEOS) |
589 const std::string& profile = | 589 const std::string& profile = |
590 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); | 590 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); |
591 if (!profile.empty()) | 591 if (!profile.empty()) |
592 command_line->AppendSwitchASCII(switches::kLoginProfile, profile); | 592 command_line->AppendSwitchASCII(switches::kLoginProfile, profile); |
593 #endif | 593 #endif |
| 594 |
| 595 PrefService* prefs = profile()->GetPrefs(); |
| 596 // Currently this pref is only registered if applied via a policy. |
| 597 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
| 598 prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
| 599 // Turn this policy into a command line switch. |
| 600 command_line->AppendSwitch(switches::kDisable3DAPIs); |
| 601 } |
594 } | 602 } |
595 | 603 |
596 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( | 604 void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( |
597 const CommandLine& browser_cmd, | 605 const CommandLine& browser_cmd, |
598 CommandLine* renderer_cmd) const { | 606 CommandLine* renderer_cmd) const { |
599 // Propagate the following switches to the renderer command line (along | 607 // Propagate the following switches to the renderer command line (along |
600 // with any associated values) if present in the browser command line. | 608 // with any associated values) if present in the browser command line. |
601 static const char* const kSwitchNames[] = { | 609 static const char* const kSwitchNames[] = { |
602 switches::kRendererAssertTest, | 610 switches::kRendererAssertTest, |
603 #if !defined(OFFICIAL_BUILD) | 611 #if !defined(OFFICIAL_BUILD) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 switches::kBlockNonSandboxedPlugins, | 694 switches::kBlockNonSandboxedPlugins, |
687 switches::kBlockOutdatedPlugins, | 695 switches::kBlockOutdatedPlugins, |
688 switches::kEnableRemoting, | 696 switches::kEnableRemoting, |
689 switches::kEnableClickToPlay, | 697 switches::kEnableClickToPlay, |
690 switches::kEnableResourceContentSettings, | 698 switches::kEnableResourceContentSettings, |
691 switches::kPrelaunchGpuProcess, | 699 switches::kPrelaunchGpuProcess, |
692 switches::kEnableAcceleratedDecoding, | 700 switches::kEnableAcceleratedDecoding, |
693 switches::kDisableFileSystem, | 701 switches::kDisableFileSystem, |
694 switches::kPpapiOutOfProcess, | 702 switches::kPpapiOutOfProcess, |
695 switches::kEnablePrintPreview, | 703 switches::kEnablePrintPreview, |
696 switches::kEnableCrxlessWebApps | 704 switches::kEnableCrxlessWebApps, |
| 705 switches::kDisable3DAPIs |
697 }; | 706 }; |
698 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 707 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
699 arraysize(kSwitchNames)); | 708 arraysize(kSwitchNames)); |
700 | 709 |
701 // Disable databases in incognito mode. | 710 // Disable databases in incognito mode. |
702 if (profile()->IsOffTheRecord() && | 711 if (profile()->IsOffTheRecord() && |
703 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 712 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
704 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 713 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
705 } | 714 } |
706 | 715 |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 IPC::PlatformFileForTransit file; | 1293 IPC::PlatformFileForTransit file; |
1285 #if defined(OS_POSIX) | 1294 #if defined(OS_POSIX) |
1286 file = base::FileDescriptor(model_file, false); | 1295 file = base::FileDescriptor(model_file, false); |
1287 #elif defined(OS_WIN) | 1296 #elif defined(OS_WIN) |
1288 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1297 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
1289 false, DUPLICATE_SAME_ACCESS); | 1298 false, DUPLICATE_SAME_ACCESS); |
1290 #endif | 1299 #endif |
1291 Send(new ViewMsg_SetPhishingModel(file)); | 1300 Send(new ViewMsg_SetPhishingModel(file)); |
1292 } | 1301 } |
1293 } | 1302 } |
OLD | NEW |