OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "content/common/notification_service.h" | 24 #include "content/common/notification_service.h" |
25 #include "content/common/result_codes.h" | 25 #include "content/common/result_codes.h" |
26 | 26 |
27 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
28 #include "chrome/browser/chrome_browser_application_mac.h" | 28 #include "chrome/browser/chrome_browser_application_mac.h" |
29 #endif | 29 #endif |
30 | 30 |
31 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
32 #include "chrome/browser/chromeos/boot_times_loader.h" | 32 #include "chrome/browser/chromeos/boot_times_loader.h" |
33 #include "chrome/browser/chromeos/cros/cros_library.h" | 33 #include "chrome/browser/chromeos/cros/cros_library.h" |
34 #include "chrome/browser/chromeos/cros/login_library.h" | |
35 #include "chrome/browser/chromeos/cros/update_library.h" | 34 #include "chrome/browser/chromeos/cros/update_library.h" |
| 35 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 36 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
36 #if defined(TOOLKIT_USES_GTK) | 37 #if defined(TOOLKIT_USES_GTK) |
37 #include "chrome/browser/chromeos/wm_ipc.h" | 38 #include "chrome/browser/chromeos/wm_ipc.h" |
38 #endif | 39 #endif |
39 #endif | 40 #endif |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 // This object is instantiated when the first Browser object is added to the | 44 // This object is instantiated when the first Browser object is added to the |
44 // list and delete when the last one is removed. It watches for loads and | 45 // list and delete when the last one is removed. It watches for loads and |
45 // creates histograms of some global object counts. | 46 // creates histograms of some global object counts. |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 301 |
301 #if defined(OS_CHROMEOS) | 302 #if defined(OS_CHROMEOS) |
302 NotifyWindowManagerAboutSignout(); | 303 NotifyWindowManagerAboutSignout(); |
303 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); | 304 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); |
304 if (cros_library->EnsureLoaded()) { | 305 if (cros_library->EnsureLoaded()) { |
305 // If update has been installed, reboot, otherwise, sign out. | 306 // If update has been installed, reboot, otherwise, sign out. |
306 if (cros_library->GetUpdateLibrary()->status().status == | 307 if (cros_library->GetUpdateLibrary()->status().status == |
307 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 308 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
308 cros_library->GetUpdateLibrary()->RebootAfterUpdate(); | 309 cros_library->GetUpdateLibrary()->RebootAfterUpdate(); |
309 } else { | 310 } else { |
310 cros_library->GetLoginLibrary()->StopSession(""); | 311 chromeos::DBusThreadManager::Get()->session_manager_client() |
| 312 ->StopSession(); |
311 } | 313 } |
312 return; | 314 return; |
313 } | 315 } |
314 // If running the Chrome OS build, but we're not on the device, fall through | 316 // If running the Chrome OS build, but we're not on the device, fall through |
315 #endif | 317 #endif |
316 AllBrowsersClosedAndAppExiting(); | 318 AllBrowsersClosedAndAppExiting(); |
317 } | 319 } |
318 | 320 |
319 // static | 321 // static |
320 void BrowserList::RemoveBrowser(Browser* browser) { | 322 void BrowserList::RemoveBrowser(Browser* browser) { |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 789 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
788 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 790 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
789 cur_ = *bg_printing_iterator_; | 791 cur_ = *bg_printing_iterator_; |
790 CHECK(cur_); | 792 CHECK(cur_); |
791 ++bg_printing_iterator_; | 793 ++bg_printing_iterator_; |
792 return; | 794 return; |
793 } | 795 } |
794 // Reached the end - no more TabContents. | 796 // Reached the end - no more TabContents. |
795 cur_ = NULL; | 797 cur_ = NULL; |
796 } | 798 } |
OLD | NEW |