| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 #include "content/public/common/content_switches.h" | 104 #include "content/public/common/content_switches.h" |
| 105 #include "extensions/common/constants.h" | 105 #include "extensions/common/constants.h" |
| 106 #include "net/socket/client_socket_pool_manager.h" | 106 #include "net/socket/client_socket_pool_manager.h" |
| 107 #include "net/url_request/url_request_context_getter.h" | 107 #include "net/url_request/url_request_context_getter.h" |
| 108 #include "ui/base/idle/idle.h" | 108 #include "ui/base/idle/idle.h" |
| 109 #include "ui/base/l10n/l10n_util.h" | 109 #include "ui/base/l10n/l10n_util.h" |
| 110 #include "ui/message_center/message_center.h" | 110 #include "ui/message_center/message_center.h" |
| 111 | 111 |
| 112 #if defined(OS_WIN) | 112 #if defined(OS_WIN) |
| 113 #include "base/win/windows_version.h" | 113 #include "base/win/windows_version.h" |
| 114 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
| 114 #include "ui/views/focus/view_storage.h" | 115 #include "ui/views/focus/view_storage.h" |
| 115 #elif defined(OS_MACOSX) | 116 #elif defined(OS_MACOSX) |
| 116 #include "chrome/browser/chrome_browser_main_mac.h" | 117 #include "chrome/browser/chrome_browser_main_mac.h" |
| 117 #endif | 118 #endif |
| 118 | 119 |
| 119 #if !defined(OS_ANDROID) | 120 #if !defined(OS_ANDROID) |
| 120 #include "chrome/browser/ui/user_manager.h" | 121 #include "chrome/browser/ui/user_manager.h" |
| 121 #include "components/gcm_driver/gcm_client_factory.h" | 122 #include "components/gcm_driver/gcm_client_factory.h" |
| 122 #include "components/gcm_driver/gcm_desktop_utils.h" | 123 #include "components/gcm_driver/gcm_desktop_utils.h" |
| 123 #endif | 124 #endif |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 new_cl->AppendSwitch(i->first); | 1262 new_cl->AppendSwitch(i->first); |
| 1262 } | 1263 } |
| 1263 } | 1264 } |
| 1264 | 1265 |
| 1265 // Ensure that our desired switches are set on the new process. | 1266 // Ensure that our desired switches are set on the new process. |
| 1266 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { | 1267 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { |
| 1267 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) | 1268 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) |
| 1268 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); | 1269 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); |
| 1269 } | 1270 } |
| 1270 | 1271 |
| 1272 #if defined(OS_WIN) |
| 1273 if (startup_metric_utils::GetPreReadOptions().prefetch_argument) |
| 1274 new_cl->AppendArg(switches::kPrefetchArgumentBrowserBackground); |
| 1275 #endif // defined(OS_WIN) |
| 1276 |
| 1271 DLOG(WARNING) << "Shutting down current instance of the browser."; | 1277 DLOG(WARNING) << "Shutting down current instance of the browser."; |
| 1272 chrome::AttemptExit(); | 1278 chrome::AttemptExit(); |
| 1273 | 1279 |
| 1274 // Transfer ownership to Upgrade. | 1280 // Transfer ownership to Upgrade. |
| 1275 upgrade_util::SetNewCommandLine(new_cl.release()); | 1281 upgrade_util::SetNewCommandLine(new_cl.release()); |
| 1276 } | 1282 } |
| 1277 | 1283 |
| 1278 void BrowserProcessImpl::OnAutoupdateTimer() { | 1284 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1279 if (CanAutorestartForUpdate()) { | 1285 if (CanAutorestartForUpdate()) { |
| 1280 DLOG(WARNING) << "Detected update. Restarting browser."; | 1286 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1281 RestartBackgroundInstance(); | 1287 RestartBackgroundInstance(); |
| 1282 } | 1288 } |
| 1283 } | 1289 } |
| 1284 | 1290 |
| 1285 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1291 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |