| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 bool value = local_state()->GetBoolean(prefs::kAllowCrossOriginAuthPrompt); | 947 bool value = local_state()->GetBoolean(prefs::kAllowCrossOriginAuthPrompt); |
| 948 ResourceDispatcherHost::Get()->SetAllowCrossOriginAuthPrompt(value); | 948 ResourceDispatcherHost::Get()->SetAllowCrossOriginAuthPrompt(value); |
| 949 } | 949 } |
| 950 | 950 |
| 951 // Mac is currently not supported. | 951 // Mac is currently not supported. |
| 952 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 952 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 953 | 953 |
| 954 bool BrowserProcessImpl::CanAutorestartForUpdate() const { | 954 bool BrowserProcessImpl::CanAutorestartForUpdate() const { |
| 955 // Check if browser is in the background and if it needs to be restarted to | 955 // Check if browser is in the background and if it needs to be restarted to |
| 956 // apply a pending update. | 956 // apply a pending update. |
| 957 return BrowserList::size() == 0 && browser::WillKeepAlive() && | 957 return BrowserList::empty() && chrome::WillKeepAlive() && |
| 958 upgrade_util::IsUpdatePendingRestart(); | 958 upgrade_util::IsUpdatePendingRestart(); |
| 959 } | 959 } |
| 960 | 960 |
| 961 // Switches to add when auto-restarting Chrome. | 961 // Switches to add when auto-restarting Chrome. |
| 962 const char* const kSwitchesToAddOnAutorestart[] = { | 962 const char* const kSwitchesToAddOnAutorestart[] = { |
| 963 switches::kNoStartupWindow | 963 switches::kNoStartupWindow |
| 964 }; | 964 }; |
| 965 | 965 |
| 966 void BrowserProcessImpl::RestartBackgroundInstance() { | 966 void BrowserProcessImpl::RestartBackgroundInstance() { |
| 967 CommandLine* old_cl = CommandLine::ForCurrentProcess(); | 967 CommandLine* old_cl = CommandLine::ForCurrentProcess(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 998 } | 998 } |
| 999 | 999 |
| 1000 void BrowserProcessImpl::OnAutoupdateTimer() { | 1000 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1001 if (CanAutorestartForUpdate()) { | 1001 if (CanAutorestartForUpdate()) { |
| 1002 DLOG(WARNING) << "Detected update. Restarting browser."; | 1002 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1003 RestartBackgroundInstance(); | 1003 RestartBackgroundInstance(); |
| 1004 } | 1004 } |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1007 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |