| OLD | NEW |
| 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 710 |
| 711 have_inspector_files_ = result; | 711 have_inspector_files_ = result; |
| 712 } | 712 } |
| 713 | 713 |
| 714 // Mac is currently not supported. | 714 // Mac is currently not supported. |
| 715 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 715 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 716 | 716 |
| 717 bool BrowserProcessImpl::CanAutorestartForUpdate() const { | 717 bool BrowserProcessImpl::CanAutorestartForUpdate() const { |
| 718 // Check if browser is in the background and if it needs to be restarted to | 718 // Check if browser is in the background and if it needs to be restarted to |
| 719 // apply a pending update. | 719 // apply a pending update. |
| 720 return BrowserList::size() == 0 && !BrowserList::WillKeepAlive() && | 720 return BrowserList::size() == 0 && BrowserList::WillKeepAlive() && |
| 721 Upgrade::IsUpdatePendingRestart(); | 721 Upgrade::IsUpdatePendingRestart(); |
| 722 } | 722 } |
| 723 | 723 |
| 724 // Switches enumerated here will be removed when a background instance of | 724 // Switches enumerated here will be removed when a background instance of |
| 725 // Chrome restarts itself. If your key is designed to only be used once, | 725 // Chrome restarts itself. If your key is designed to only be used once, |
| 726 // or if it does not make sense when restarting a background instance to | 726 // or if it does not make sense when restarting a background instance to |
| 727 // pick up an automatic update, be sure to add it to this list. | 727 // pick up an automatic update, be sure to add it to this list. |
| 728 const char* const kSwitchesToRemoveOnAutorestart[] = { | 728 const char* const kSwitchesToRemoveOnAutorestart[] = { |
| 729 switches::kApp, | 729 switches::kApp, |
| 730 switches::kFirstRun, | 730 switches::kFirstRun, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 } | 775 } |
| 776 | 776 |
| 777 void BrowserProcessImpl::OnAutoupdateTimer() { | 777 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 778 if (CanAutorestartForUpdate()) { | 778 if (CanAutorestartForUpdate()) { |
| 779 DLOG(WARNING) << "Detected update. Restarting browser."; | 779 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 780 RestartPersistentInstance(); | 780 RestartPersistentInstance(); |
| 781 } | 781 } |
| 782 } | 782 } |
| 783 | 783 |
| 784 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 784 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |