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 "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/public/browser/navigation_details.h" | 27 #include "content/public/browser/navigation_details.h" |
28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
29 | 29 |
30 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
31 #include "chrome/browser/chrome_browser_application_mac.h" | 31 #include "chrome/browser/chrome_browser_application_mac.h" |
32 #endif | 32 #endif |
33 | 33 |
34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
35 #include "base/chromeos/chromeos_version.h" | 35 #include "base/chromeos/chromeos_version.h" |
36 #include "chrome/browser/chromeos/boot_times_loader.h" | 36 #include "chrome/browser/chromeos/boot_times_loader.h" |
37 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_metrics.h" | |
38 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | |
39 #include "chrome/browser/chromeos/login/user_manager.h" | 37 #include "chrome/browser/chromeos/login/user_manager.h" |
40 #include "chromeos/dbus/dbus_thread_manager.h" | 38 #include "chromeos/dbus/dbus_thread_manager.h" |
41 #include "chromeos/dbus/session_manager_client.h" | 39 #include "chromeos/dbus/session_manager_client.h" |
42 #include "chromeos/dbus/update_engine_client.h" | 40 #include "chromeos/dbus/update_engine_client.h" |
43 #endif | 41 #endif |
44 | 42 |
45 namespace browser { | 43 namespace browser { |
46 namespace { | 44 namespace { |
47 | 45 |
48 // Returns true if all browsers can be closed without user interaction. | 46 // Returns true if all browsers can be closed without user interaction. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (notified || g_session_manager_requested_shutdown) | 117 if (notified || g_session_manager_requested_shutdown) |
120 return; | 118 return; |
121 notified = true; | 119 notified = true; |
122 #endif | 120 #endif |
123 | 121 |
124 if (fast_path) | 122 if (fast_path) |
125 NotifyAppTerminating(); | 123 NotifyAppTerminating(); |
126 | 124 |
127 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
128 if (base::chromeos::IsRunningOnChromeOS()) { | 126 if (base::chromeos::IsRunningOnChromeOS()) { |
129 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | |
130 chromeos::KioskModeMetrics::Get()->SessionEnded(); | |
131 | |
132 // If we're on a ChromeOS device, reboot if an update has been applied, | 127 // If we're on a ChromeOS device, reboot if an update has been applied, |
133 // or else signal the session manager to log out. | 128 // or else signal the session manager to log out. |
134 chromeos::UpdateEngineClient* update_engine_client | 129 chromeos::UpdateEngineClient* update_engine_client |
135 = chromeos::DBusThreadManager::Get()->GetUpdateEngineClient(); | 130 = chromeos::DBusThreadManager::Get()->GetUpdateEngineClient(); |
136 if (update_engine_client->GetLastStatus().status == | 131 if (update_engine_client->GetLastStatus().status == |
137 chromeos::UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 132 chromeos::UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
138 update_engine_client->RebootAfterUpdate(); | 133 update_engine_client->RebootAfterUpdate(); |
139 } else { | 134 } else { |
140 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() | 135 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() |
141 ->StopSession(); | 136 ->StopSession(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 MessageLoop::current()) | 355 MessageLoop::current()) |
361 CloseAllBrowsers(); | 356 CloseAllBrowsers(); |
362 } | 357 } |
363 } | 358 } |
364 | 359 |
365 bool WillKeepAlive() { | 360 bool WillKeepAlive() { |
366 return g_keep_alive_count > 0; | 361 return g_keep_alive_count > 0; |
367 } | 362 } |
368 | 363 |
369 } // namespace browser | 364 } // namespace browser |
OLD | NEW |