Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 12096060: browser: Start moving application_lifetime.h functions into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « chrome/browser/background/background_mode_manager_unittest.cc ('k') | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698