| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
| 129 #include "chrome/browser/chrome_browser_main_win.h" | 129 #include "chrome/browser/chrome_browser_main_win.h" |
| 130 #include "sandbox/win/src/sandbox_policy.h" | 130 #include "sandbox/win/src/sandbox_policy.h" |
| 131 #elif defined(OS_MACOSX) | 131 #elif defined(OS_MACOSX) |
| 132 #include "chrome/browser/chrome_browser_main_mac.h" | 132 #include "chrome/browser/chrome_browser_main_mac.h" |
| 133 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 133 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
| 134 #elif defined(OS_CHROMEOS) | 134 #elif defined(OS_CHROMEOS) |
| 135 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 135 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 136 #include "chrome/browser/chromeos/login/user_manager.h" | 136 #include "chrome/browser/chromeos/login/user_manager.h" |
| 137 #include "chromeos/chromeos_switches.h" | |
| 138 #elif defined(OS_LINUX) | 137 #elif defined(OS_LINUX) |
| 139 #include "chrome/browser/chrome_browser_main_linux.h" | 138 #include "chrome/browser/chrome_browser_main_linux.h" |
| 140 #elif defined(OS_ANDROID) | 139 #elif defined(OS_ANDROID) |
| 141 #include "chrome/browser/android/crash_dump_manager.h" | 140 #include "chrome/browser/android/crash_dump_manager.h" |
| 142 #include "chrome/browser/chrome_browser_main_android.h" | 141 #include "chrome/browser/chrome_browser_main_android.h" |
| 143 #include "chrome/common/descriptors_android.h" | 142 #include "chrome/common/descriptors_android.h" |
| 144 #elif defined(OS_POSIX) | 143 #elif defined(OS_POSIX) |
| 145 #include "chrome/browser/chrome_browser_main_posix.h" | 144 #include "chrome/browser/chrome_browser_main_posix.h" |
| 146 #endif | 145 #endif |
| 147 | 146 |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 if (browser_command_line.HasSwitch(switches::kChromeFrame)) | 1100 if (browser_command_line.HasSwitch(switches::kChromeFrame)) |
| 1102 command_line->AppendSwitch(switches::kChromeFrame); | 1101 command_line->AppendSwitch(switches::kChromeFrame); |
| 1103 | 1102 |
| 1104 if (process_type == switches::kRendererProcess) { | 1103 if (process_type == switches::kRendererProcess) { |
| 1105 base::FilePath user_data_dir = | 1104 base::FilePath user_data_dir = |
| 1106 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 1105 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
| 1107 if (!user_data_dir.empty()) | 1106 if (!user_data_dir.empty()) |
| 1108 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 1107 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 1109 #if defined(OS_CHROMEOS) | 1108 #if defined(OS_CHROMEOS) |
| 1110 const std::string& login_profile = | 1109 const std::string& login_profile = |
| 1111 browser_command_line.GetSwitchValueASCII( | 1110 browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); |
| 1112 chromeos::switches::kLoginProfile); | |
| 1113 if (!login_profile.empty()) | 1111 if (!login_profile.empty()) |
| 1114 command_line->AppendSwitchASCII( | 1112 command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); |
| 1115 chromeos::switches::kLoginProfile, login_profile); | |
| 1116 #endif | 1113 #endif |
| 1117 | 1114 |
| 1118 content::RenderProcessHost* process = | 1115 content::RenderProcessHost* process = |
| 1119 content::RenderProcessHost::FromID(child_process_id); | 1116 content::RenderProcessHost::FromID(child_process_id); |
| 1120 if (process) { | 1117 if (process) { |
| 1121 Profile* profile = Profile::FromBrowserContext( | 1118 Profile* profile = Profile::FromBrowserContext( |
| 1122 process->GetBrowserContext()); | 1119 process->GetBrowserContext()); |
| 1123 ExtensionService* extension_service = | 1120 ExtensionService* extension_service = |
| 1124 extensions::ExtensionSystem::Get(profile)->extension_service(); | 1121 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 1125 if (extension_service) { | 1122 if (extension_service) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 static const char* const kSwitchNames[] = { | 1210 static const char* const kSwitchNames[] = { |
| 1214 switches::kAllowHTTPBackgroundPage, | 1211 switches::kAllowHTTPBackgroundPage, |
| 1215 switches::kEnableExperimentalExtensionApis, | 1212 switches::kEnableExperimentalExtensionApis, |
| 1216 switches::kWhitelistedExtensionID, | 1213 switches::kWhitelistedExtensionID, |
| 1217 }; | 1214 }; |
| 1218 | 1215 |
| 1219 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1216 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
| 1220 arraysize(kSwitchNames)); | 1217 arraysize(kSwitchNames)); |
| 1221 } else if (process_type == switches::kPluginProcess) { | 1218 } else if (process_type == switches::kPluginProcess) { |
| 1222 static const char* const kSwitchNames[] = { | 1219 static const char* const kSwitchNames[] = { |
| 1223 #if defined(OS_CHROMEOS) | 1220 #if defined(OS_CHROMEOS) |
| 1224 chromeos::switches::kLoginProfile, | 1221 switches::kLoginProfile, |
| 1225 #endif | 1222 #endif |
| 1226 switches::kMemoryProfiling, | 1223 switches::kMemoryProfiling, |
| 1227 switches::kSilentDumpOnDCHECK, | 1224 switches::kSilentDumpOnDCHECK, |
| 1228 switches::kUserDataDir, | 1225 switches::kUserDataDir, |
| 1229 }; | 1226 }; |
| 1230 | 1227 |
| 1231 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1228 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
| 1232 arraysize(kSwitchNames)); | 1229 arraysize(kSwitchNames)); |
| 1233 } else if (process_type == switches::kZygoteProcess) { | 1230 } else if (process_type == switches::kZygoteProcess) { |
| 1234 static const char* const kSwitchNames[] = { | 1231 static const char* const kSwitchNames[] = { |
| 1235 switches::kUserDataDir, // Make logs go to the right file. | 1232 switches::kUserDataDir, // Make logs go to the right file. |
| (...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 io_thread_application_locale_ = locale; | 2183 io_thread_application_locale_ = locale; |
| 2187 } | 2184 } |
| 2188 | 2185 |
| 2189 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2186 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 2190 const std::string& locale) { | 2187 const std::string& locale) { |
| 2191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2188 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2192 io_thread_application_locale_ = locale; | 2189 io_thread_application_locale_ = locale; |
| 2193 } | 2190 } |
| 2194 | 2191 |
| 2195 } // namespace chrome | 2192 } // namespace chrome |
| OLD | NEW |