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.h" | 5 #include "chrome/browser/ui/browser_list.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 "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
34 #include "chrome/browser/chrome_browser_application_mac.h" | 34 #include "chrome/browser/chrome_browser_application_mac.h" |
35 #endif | 35 #endif |
36 | 36 |
37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
38 #include "base/chromeos/chromeos_version.h" | 38 #include "base/chromeos/chromeos_version.h" |
39 #include "chrome/browser/chromeos/boot_times_loader.h" | 39 #include "chrome/browser/chromeos/boot_times_loader.h" |
40 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 40 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
41 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 41 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
42 #include "chrome/browser/chromeos/dbus/update_engine_client.h" | 42 #include "chrome/browser/chromeos/dbus/update_engine_client.h" |
43 #if defined(TOOLKIT_USES_GTK) | |
44 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | |
45 #endif | |
46 #endif | 43 #endif |
47 | 44 |
48 using content::WebContents; | 45 using content::WebContents; |
49 | 46 |
50 namespace { | 47 namespace { |
51 | 48 |
52 // This object is instantiated when the first Browser object is added to the | 49 // This object is instantiated when the first Browser object is added to the |
53 // list and delete when the last one is removed. It watches for loads and | 50 // list and delete when the last one is removed. It watches for loads and |
54 // creates histograms of some global object counts. | 51 // creates histograms of some global object counts. |
55 class BrowserActivityObserver : public content::NotificationObserver { | 52 class BrowserActivityObserver : public content::NotificationObserver { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // Returns true if fast shutdown is successfully started. | 249 // Returns true if fast shutdown is successfully started. |
253 bool FastShutdown() { | 250 bool FastShutdown() { |
254 if (AreAllBrowsersCloseable()) { | 251 if (AreAllBrowsersCloseable()) { |
255 BrowserList::NotifyAndTerminate(true); | 252 BrowserList::NotifyAndTerminate(true); |
256 return true; | 253 return true; |
257 } | 254 } |
258 return false; | 255 return false; |
259 } | 256 } |
260 | 257 |
261 void NotifyWindowManagerAboutSignout() { | 258 void NotifyWindowManagerAboutSignout() { |
262 #if defined(TOOLKIT_USES_GTK) | |
263 static bool notified = false; | |
264 if (!notified) { | |
265 // Let the window manager know that we're going away before we start closing | |
266 // windows so it can display a graceful transition to a black screen. | |
267 chromeos::WmIpc::instance()->NotifyAboutSignout(); | |
268 notified = true; | |
269 } | |
270 #endif | |
271 } | 259 } |
272 | 260 |
273 #endif | 261 #endif |
274 | 262 |
275 } // namespace | 263 } // namespace |
276 | 264 |
277 // static | 265 // static |
278 void BrowserList::AddBrowser(Browser* browser) { | 266 void BrowserList::AddBrowser(Browser* browser) { |
279 DCHECK(browser); | 267 DCHECK(browser); |
280 browsers().push_back(browser); | 268 browsers().push_back(browser); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 855 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
868 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 856 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
869 cur_ = *bg_printing_iterator_; | 857 cur_ = *bg_printing_iterator_; |
870 CHECK(cur_); | 858 CHECK(cur_); |
871 ++bg_printing_iterator_; | 859 ++bg_printing_iterator_; |
872 return; | 860 return; |
873 } | 861 } |
874 // Reached the end - no more TabContents. | 862 // Reached the end - no more TabContents. |
875 cur_ = NULL; | 863 cur_ = NULL; |
876 } | 864 } |
OLD | NEW |