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/lifetime/application_lifetime.h" | 5 #include "chrome/browser/lifetime/application_lifetime.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
33 #include "content/public/browser/browser_shutdown.h" | 33 #include "content/public/browser/browser_shutdown.h" |
34 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/navigation_details.h" | 35 #include "content/public/browser/navigation_details.h" |
36 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
37 | 37 |
38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
39 #include "base/chromeos/chromeos_version.h" | 39 #include "base/sys_info.h" |
40 #include "chrome/browser/chromeos/boot_times_loader.h" | 40 #include "chrome/browser/chromeos/boot_times_loader.h" |
41 #include "chrome/browser/chromeos/login/user_manager.h" | 41 #include "chrome/browser/chromeos/login/user_manager.h" |
42 #include "chromeos/dbus/dbus_thread_manager.h" | 42 #include "chromeos/dbus/dbus_thread_manager.h" |
43 #include "chromeos/dbus/session_manager_client.h" | 43 #include "chromeos/dbus/session_manager_client.h" |
44 #include "chromeos/dbus/update_engine_client.h" | 44 #include "chromeos/dbus/update_engine_client.h" |
45 #endif | 45 #endif |
46 | 46 |
47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
48 #include "base/win/win_util.h" | 48 #include "base/win/win_util.h" |
49 #endif | 49 #endif |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // Return if a shutdown request has already been sent. | 328 // Return if a shutdown request has already been sent. |
329 if (notified) | 329 if (notified) |
330 return; | 330 return; |
331 notified = true; | 331 notified = true; |
332 #endif | 332 #endif |
333 | 333 |
334 if (fast_path) | 334 if (fast_path) |
335 NotifyAppTerminating(); | 335 NotifyAppTerminating(); |
336 | 336 |
337 #if defined(OS_CHROMEOS) | 337 #if defined(OS_CHROMEOS) |
338 if (base::chromeos::IsRunningOnChromeOS()) { | 338 if (base::SysInfo::IsRunningOnChromeOS()) { |
339 // If we're on a ChromeOS device, reboot if an update has been applied, | 339 // If we're on a ChromeOS device, reboot if an update has been applied, |
340 // or else signal the session manager to log out. | 340 // or else signal the session manager to log out. |
341 chromeos::UpdateEngineClient* update_engine_client | 341 chromeos::UpdateEngineClient* update_engine_client |
342 = chromeos::DBusThreadManager::Get()->GetUpdateEngineClient(); | 342 = chromeos::DBusThreadManager::Get()->GetUpdateEngineClient(); |
343 if (update_engine_client->GetLastStatus().status == | 343 if (update_engine_client->GetLastStatus().status == |
344 chromeos::UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 344 chromeos::UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
345 update_engine_client->RebootAfterUpdate(); | 345 update_engine_client->RebootAfterUpdate(); |
346 } else if (!g_session_manager_requested_shutdown) { | 346 } else if (!g_session_manager_requested_shutdown) { |
347 // Don't ask SessionManager to stop session if the shutdown request comes | 347 // Don't ask SessionManager to stop session if the shutdown request comes |
348 // from session manager. | 348 // from session manager. |
(...skipping 30 matching lines...) Expand all Loading... |
379 // environment is still active. | 379 // environment is still active. |
380 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 380 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
381 return !ash::Shell::HasInstance(); | 381 return !ash::Shell::HasInstance(); |
382 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 382 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
383 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 383 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
384 #endif | 384 #endif |
385 return true; | 385 return true; |
386 } | 386 } |
387 | 387 |
388 } // namespace chrome | 388 } // namespace chrome |
OLD | NEW |