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