| 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/ui/browser_list_impl.h" | 5 #include "chrome/browser/ui/browser_list_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_shutdown.h" | 10 #include "chrome/browser/browser_shutdown.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // If we're exiting, send out the APP_TERMINATING notification to allow other | 84 // If we're exiting, send out the APP_TERMINATING notification to allow other |
| 85 // modules to shut themselves down. | 85 // modules to shut themselves down. |
| 86 if (browsers_.empty() && | 86 if (browsers_.empty() && |
| 87 (browser_shutdown::IsTryingToQuit() || | 87 (browser_shutdown::IsTryingToQuit() || |
| 88 g_browser_process->IsShuttingDown())) { | 88 g_browser_process->IsShuttingDown())) { |
| 89 // Last browser has just closed, and this is a user-initiated quit or there | 89 // Last browser has just closed, and this is a user-initiated quit or there |
| 90 // is no module keeping the app alive, so send out our notification. No need | 90 // is no module keeping the app alive, so send out our notification. No need |
| 91 // to call ProfileManager::ShutdownSessionServices() as part of the | 91 // to call ProfileManager::ShutdownSessionServices() as part of the |
| 92 // shutdown, because Browser::WindowClosing() already makes sure that the | 92 // shutdown, because Browser::WindowClosing() already makes sure that the |
| 93 // SessionService is created and notified. | 93 // SessionService is created and notified. |
| 94 browser::NotifyAppTerminating(); | 94 chrome::NotifyAppTerminating(); |
| 95 browser::OnAppExiting(); | 95 chrome::OnAppExiting(); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 void BrowserListImpl::AddObserver(BrowserListObserver* observer) { | 99 void BrowserListImpl::AddObserver(BrowserListObserver* observer) { |
| 100 observers_.AddObserver(observer); | 100 observers_.AddObserver(observer); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void BrowserListImpl::RemoveObserver(BrowserListObserver* observer) { | 103 void BrowserListImpl::RemoveObserver(BrowserListObserver* observer) { |
| 104 observers_.RemoveObserver(observer); | 104 observers_.RemoveObserver(observer); |
| 105 } | 105 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void BrowserListImpl::RemoveBrowserFrom(Browser* browser, | 170 void BrowserListImpl::RemoveBrowserFrom(Browser* browser, |
| 171 BrowserVector* browser_list) { | 171 BrowserVector* browser_list) { |
| 172 const iterator remove_browser = | 172 const iterator remove_browser = |
| 173 std::find(browser_list->begin(), browser_list->end(), browser); | 173 std::find(browser_list->begin(), browser_list->end(), browser); |
| 174 if (remove_browser != browser_list->end()) | 174 if (remove_browser != browser_list->end()) |
| 175 browser_list->erase(remove_browser); | 175 browser_list->erase(remove_browser); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace chrome | 178 } // namespace chrome |
| OLD | NEW |