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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "chrome/browser/shell_integration.h" | 71 #include "chrome/browser/shell_integration.h" |
72 #include "chrome/browser/status_icons/status_tray.h" | 72 #include "chrome/browser/status_icons/status_tray.h" |
73 #include "chrome/browser/ui/browser_dialogs.h" | 73 #include "chrome/browser/ui/browser_dialogs.h" |
74 #include "chrome/browser/ui/browser_finder.h" | 74 #include "chrome/browser/ui/browser_finder.h" |
75 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" | 75 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" |
76 #include "chrome/common/channel_info.h" | 76 #include "chrome/common/channel_info.h" |
77 #include "chrome/common/chrome_constants.h" | 77 #include "chrome/common/chrome_constants.h" |
78 #include "chrome/common/chrome_paths.h" | 78 #include "chrome/common/chrome_paths.h" |
79 #include "chrome/common/chrome_switches.h" | 79 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/extensions/chrome_extensions_client.h" | 80 #include "chrome/common/extensions/chrome_extensions_client.h" |
81 #include "chrome/common/extensions/extension_process_policy.h" | |
82 #include "chrome/common/features.h" | 81 #include "chrome/common/features.h" |
83 #include "chrome/common/pref_names.h" | 82 #include "chrome/common/pref_names.h" |
84 #include "chrome/common/switch_utils.h" | 83 #include "chrome/common/switch_utils.h" |
85 #include "chrome/common/url_constants.h" | 84 #include "chrome/common/url_constants.h" |
86 #include "chrome/installer/util/google_update_constants.h" | 85 #include "chrome/installer/util/google_update_constants.h" |
87 #include "chrome/installer/util/google_update_settings.h" | 86 #include "chrome/installer/util/google_update_settings.h" |
88 #include "components/component_updater/component_updater_service.h" | 87 #include "components/component_updater/component_updater_service.h" |
89 #include "components/gcm_driver/gcm_driver.h" | 88 #include "components/gcm_driver/gcm_driver.h" |
90 #include "components/metrics/metrics_pref_names.h" | 89 #include "components/metrics/metrics_pref_names.h" |
91 #include "components/metrics/metrics_service.h" | 90 #include "components/metrics/metrics_service.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 print_job_manager_.reset(new printing::PrintJobManager); | 213 print_job_manager_.reset(new printing::PrintJobManager); |
215 #endif | 214 #endif |
216 | 215 |
217 base::FilePath net_log_path; | 216 base::FilePath net_log_path; |
218 if (command_line.HasSwitch(switches::kLogNetLog)) | 217 if (command_line.HasSwitch(switches::kLogNetLog)) |
219 net_log_path = command_line.GetSwitchValuePath(switches::kLogNetLog); | 218 net_log_path = command_line.GetSwitchValuePath(switches::kLogNetLog); |
220 net_log_.reset(new net_log::ChromeNetLog( | 219 net_log_.reset(new net_log::ChromeNetLog( |
221 net_log_path, GetNetCaptureModeFromCommandLine(command_line), | 220 net_log_path, GetNetCaptureModeFromCommandLine(command_line), |
222 command_line.GetCommandLineString(), chrome::GetChannelString())); | 221 command_line.GetCommandLineString(), chrome::GetChannelString())); |
223 | 222 |
224 #if defined(ENABLE_EXTENSIONS) | 223 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
225 if (extensions::IsIsolateExtensionsEnabled()) { | 224 extensions::kExtensionScheme); |
226 // chrome-extension:// URLs are safe to request anywhere, but may only | 225 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
227 // commit (including in iframes) in extension processes. | 226 extensions::kExtensionResourceScheme); |
228 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme( | |
229 extensions::kExtensionScheme, true); | |
230 // TODO(nick): Kill off kExtensionResourceScheme. | |
231 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme( | |
232 extensions::kExtensionResourceScheme, false); | |
233 } else { | |
234 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | |
235 extensions::kExtensionScheme); | |
236 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | |
237 extensions::kExtensionResourceScheme); | |
238 } | |
239 #endif | |
240 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 227 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
241 chrome::kChromeSearchScheme); | 228 chrome::kChromeSearchScheme); |
242 | 229 |
243 #if defined(OS_MACOSX) | 230 #if defined(OS_MACOSX) |
244 ui::InitIdleMonitor(); | 231 ui::InitIdleMonitor(); |
245 #endif | 232 #endif |
246 | 233 |
247 device_client_.reset(new ChromeDeviceClient); | 234 device_client_.reset(new ChromeDeviceClient); |
248 | 235 |
249 #if defined(ENABLE_EXTENSIONS) | 236 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 } | 1345 } |
1359 | 1346 |
1360 void BrowserProcessImpl::OnAutoupdateTimer() { | 1347 void BrowserProcessImpl::OnAutoupdateTimer() { |
1361 if (CanAutorestartForUpdate()) { | 1348 if (CanAutorestartForUpdate()) { |
1362 DLOG(WARNING) << "Detected update. Restarting browser."; | 1349 DLOG(WARNING) << "Detected update. Restarting browser."; |
1363 RestartBackgroundInstance(); | 1350 RestartBackgroundInstance(); |
1364 } | 1351 } |
1365 } | 1352 } |
1366 | 1353 |
1367 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1354 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |