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

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

Issue 2866034: Refactor shutdown code to allow win/linux to run after last browser closes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Uploaded patch that resolves merge issue Created 10 years, 5 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
« no previous file with comments | « chrome/browser/browser_main_mac.mm ('k') | chrome/browser/browser_shutdown.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 7 #include <map>
8 8
9 #include "app/clipboard/clipboard.h" 9 #include "app/clipboard/clipboard.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 540
541 have_inspector_files_ = result; 541 have_inspector_files_ = result;
542 } 542 }
543 543
544 // Mac is currently not supported. 544 // Mac is currently not supported.
545 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 545 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
546 546
547 bool BrowserProcessImpl::CanAutorestartForUpdate() const { 547 bool BrowserProcessImpl::CanAutorestartForUpdate() const {
548 // Check if browser is in the background and if it needs to be restarted to 548 // Check if browser is in the background and if it needs to be restarted to
549 // apply a pending update. 549 // apply a pending update.
550 return BrowserList::IsInPersistentMode() && Upgrade::IsUpdatePendingRestart(); 550 return BrowserList::size() == 0 && !BrowserList::WillKeepAlive() &&
551 Upgrade::IsUpdatePendingRestart();
551 } 552 }
552 553
553 // Switches enumerated here will be removed when a background instance of 554 // Switches enumerated here will be removed when a background instance of
554 // Chrome restarts itself. If your key is designed to only be used once, 555 // Chrome restarts itself. If your key is designed to only be used once,
555 // or if it does not make sense when restarting a background instance to 556 // or if it does not make sense when restarting a background instance to
556 // pick up an automatic update, be sure to add it to this list. 557 // pick up an automatic update, be sure to add it to this list.
557 const char* const kSwitchesToRemoveOnAutorestart[] = { 558 const char* const kSwitchesToRemoveOnAutorestart[] = {
558 switches::kApp, 559 switches::kApp,
559 switches::kFirstRun, 560 switches::kFirstRun,
560 switches::kImport, 561 switches::kImport,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 } 598 }
598 599
599 void BrowserProcessImpl::OnAutoupdateTimer() { 600 void BrowserProcessImpl::OnAutoupdateTimer() {
600 if (CanAutorestartForUpdate()) { 601 if (CanAutorestartForUpdate()) {
601 DLOG(WARNING) << "Detected update. Restarting browser."; 602 DLOG(WARNING) << "Detected update. Restarting browser.";
602 RestartPersistentInstance(); 603 RestartPersistentInstance();
603 } 604 }
604 } 605 }
605 606
606 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 607 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_main_mac.mm ('k') | chrome/browser/browser_shutdown.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698