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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #include "content/public/common/content_switches.h" | 114 #include "content/public/common/content_switches.h" |
115 #include "extensions/common/constants.h" | 115 #include "extensions/common/constants.h" |
116 #include "net/socket/client_socket_pool_manager.h" | 116 #include "net/socket/client_socket_pool_manager.h" |
117 #include "net/url_request/url_request_context_getter.h" | 117 #include "net/url_request/url_request_context_getter.h" |
118 #include "ui/base/idle/idle.h" | 118 #include "ui/base/idle/idle.h" |
119 #include "ui/base/l10n/l10n_util.h" | 119 #include "ui/base/l10n/l10n_util.h" |
120 #include "ui/message_center/message_center.h" | 120 #include "ui/message_center/message_center.h" |
121 | 121 |
122 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
123 #include "base/win/windows_version.h" | 123 #include "base/win/windows_version.h" |
124 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" | |
125 #include "ui/views/focus/view_storage.h" | 124 #include "ui/views/focus/view_storage.h" |
126 #elif defined(OS_MACOSX) | 125 #elif defined(OS_MACOSX) |
127 #include "chrome/browser/chrome_browser_main_mac.h" | 126 #include "chrome/browser/chrome_browser_main_mac.h" |
128 #endif | 127 #endif |
129 | 128 |
130 #if !defined(OS_ANDROID) | 129 #if !defined(OS_ANDROID) |
131 #include "chrome/browser/lifetime/keep_alive_registry.h" | 130 #include "chrome/browser/lifetime/keep_alive_registry.h" |
132 #include "chrome/browser/ui/user_manager.h" | 131 #include "chrome/browser/ui/user_manager.h" |
133 #include "components/gcm_driver/gcm_client_factory.h" | 132 #include "components/gcm_driver/gcm_client_factory.h" |
134 #include "components/gcm_driver/gcm_desktop_utils.h" | 133 #include "components/gcm_driver/gcm_desktop_utils.h" |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 } | 1310 } |
1312 } | 1311 } |
1313 | 1312 |
1314 // Ensure that our desired switches are set on the new process. | 1313 // Ensure that our desired switches are set on the new process. |
1315 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { | 1314 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { |
1316 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) | 1315 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) |
1317 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); | 1316 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); |
1318 } | 1317 } |
1319 | 1318 |
1320 #if defined(OS_WIN) | 1319 #if defined(OS_WIN) |
1321 if (startup_metric_utils::GetPreReadOptions().use_prefetch_argument) | 1320 new_cl->AppendArg(switches::kPrefetchArgumentBrowserBackground); |
1322 new_cl->AppendArg(switches::kPrefetchArgumentBrowserBackground); | |
1323 #endif // defined(OS_WIN) | 1321 #endif // defined(OS_WIN) |
1324 | 1322 |
1325 DLOG(WARNING) << "Shutting down current instance of the browser."; | 1323 DLOG(WARNING) << "Shutting down current instance of the browser."; |
1326 chrome::AttemptExit(); | 1324 chrome::AttemptExit(); |
1327 | 1325 |
1328 // Transfer ownership to Upgrade. | 1326 // Transfer ownership to Upgrade. |
1329 upgrade_util::SetNewCommandLine(new_cl.release()); | 1327 upgrade_util::SetNewCommandLine(new_cl.release()); |
1330 } | 1328 } |
1331 | 1329 |
1332 void BrowserProcessImpl::OnAutoupdateTimer() { | 1330 void BrowserProcessImpl::OnAutoupdateTimer() { |
1333 if (CanAutorestartForUpdate()) { | 1331 if (CanAutorestartForUpdate()) { |
1334 DLOG(WARNING) << "Detected update. Restarting browser."; | 1332 DLOG(WARNING) << "Detected update. Restarting browser."; |
1335 RestartBackgroundInstance(); | 1333 RestartBackgroundInstance(); |
1336 } | 1334 } |
1337 } | 1335 } |
1338 | 1336 |
1339 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1337 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |