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/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/render_process_host.h" | 25 #include "content/public/browser/render_process_host.h" |
26 #include "content/public/common/result_codes.h" | 26 #include "content/public/common/result_codes.h" |
27 | 27 |
28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
29 #include "chrome/browser/chrome_browser_application_mac.h" | 29 #include "chrome/browser/chrome_browser_application_mac.h" |
30 #endif | 30 #endif |
31 | 31 |
32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
33 #include "chrome/browser/chromeos/boot_times_loader.h" | 33 #include "chrome/browser/chromeos/boot_times_loader.h" |
34 #include "chrome/browser/chromeos/cros/cros_library.h" | |
35 #include "chrome/browser/chromeos/cros/update_library.h" | |
36 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 34 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
37 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 35 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 36 #include "chrome/browser/chromeos/dbus/update_engine_client.h" |
38 #include "chrome/browser/chromeos/system/runtime_environment.h" | 37 #include "chrome/browser/chromeos/system/runtime_environment.h" |
39 #if defined(TOOLKIT_USES_GTK) | 38 #if defined(TOOLKIT_USES_GTK) |
40 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | 39 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" |
41 #endif | 40 #endif |
42 #endif | 41 #endif |
43 | 42 |
44 namespace { | 43 namespace { |
45 | 44 |
46 // This object is instantiated when the first Browser object is added to the | 45 // This object is instantiated when the first Browser object is added to the |
47 // list and delete when the last one is removed. It watches for loads and | 46 // list and delete when the last one is removed. It watches for loads and |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return; | 326 return; |
328 notified = true; | 327 notified = true; |
329 #endif | 328 #endif |
330 | 329 |
331 if (fast_path) | 330 if (fast_path) |
332 NotifyAppTerminating(); | 331 NotifyAppTerminating(); |
333 | 332 |
334 #if defined(OS_CHROMEOS) | 333 #if defined(OS_CHROMEOS) |
335 NotifyWindowManagerAboutSignout(); | 334 NotifyWindowManagerAboutSignout(); |
336 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { | 335 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { |
| 336 chromeos::UpdateEngineClient* update_engine_client |
| 337 = chromeos::DBusThreadManager::Get()->GetUpdateEngineClient(); |
337 // If update has been installed, reboot, otherwise, sign out. | 338 // If update has been installed, reboot, otherwise, sign out. |
338 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); | 339 if (update_engine_client->GetLastStatus().status == |
339 if (cros_library->GetUpdateLibrary()->status().status == | 340 chromeos::UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
340 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 341 update_engine_client->RebootAfterUpdate(); |
341 cros_library->GetUpdateLibrary()->RebootAfterUpdate(); | |
342 } else { | 342 } else { |
343 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() | 343 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() |
344 ->StopSession(); | 344 ->StopSession(); |
345 } | 345 } |
346 return; | 346 return; |
347 } | 347 } |
348 // If running the Chrome OS build, but we're not on the device, fall through | 348 // If running the Chrome OS build, but we're not on the device, fall through |
349 #endif | 349 #endif |
350 AllBrowsersClosedAndAppExiting(); | 350 AllBrowsersClosedAndAppExiting(); |
351 } | 351 } |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 857 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
858 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 858 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
859 cur_ = *bg_printing_iterator_; | 859 cur_ = *bg_printing_iterator_; |
860 CHECK(cur_); | 860 CHECK(cur_); |
861 ++bg_printing_iterator_; | 861 ++bg_printing_iterator_; |
862 return; | 862 return; |
863 } | 863 } |
864 // Reached the end - no more TabContents. | 864 // Reached the end - no more TabContents. |
865 cur_ = NULL; | 865 cur_ = NULL; |
866 } | 866 } |
OLD | NEW |