| 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 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/lifetime/browser_close_manager.h" | 24 #include "chrome/browser/lifetime/browser_close_manager.h" |
| 25 #include "chrome/browser/metrics/thread_watcher.h" | 25 #include "chrome/browser/metrics/thread_watcher.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
| 28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
| 29 #include "chrome/browser/ui/browser_finder.h" | 29 #include "chrome/browser/ui/browser_finder.h" |
| 30 #include "chrome/browser/ui/browser_iterator.h" | 30 #include "chrome/browser/ui/browser_iterator.h" |
| 31 #include "chrome/browser/ui/browser_tabstrip.h" | 31 #include "chrome/browser/ui/browser_tabstrip.h" |
| 32 #include "chrome/browser/ui/browser_window.h" | 32 #include "chrome/browser/ui/browser_window.h" |
| 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 34 #include "chrome/browser/ui/user_manager.h" |
| 34 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 36 #include "content/public/browser/browser_shutdown.h" | 37 #include "content/public/browser/browser_shutdown.h" |
| 37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/navigation_details.h" | 39 #include "content/public/browser/navigation_details.h" |
| 39 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
| 40 | 41 |
| 41 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 42 #include "base/sys_info.h" | 43 #include "base/sys_info.h" |
| 43 #include "chrome/browser/chromeos/boot_times_loader.h" | 44 #include "chrome/browser/chromeos/boot_times_loader.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 state->CommitPendingWrite(); | 161 state->CommitPendingWrite(); |
| 161 } | 162 } |
| 162 } | 163 } |
| 163 g_send_stop_request_to_session_manager = true; | 164 g_send_stop_request_to_session_manager = true; |
| 164 // On ChromeOS, always terminate the browser, regardless of the result of | 165 // On ChromeOS, always terminate the browser, regardless of the result of |
| 165 // AreAllBrowsersCloseable(). See crbug.com/123107. | 166 // AreAllBrowsersCloseable(). See crbug.com/123107. |
| 166 chrome::NotifyAndTerminate(true); | 167 chrome::NotifyAndTerminate(true); |
| 167 #else | 168 #else |
| 168 // Reset the restart bit that might have been set in cancelled restart | 169 // Reset the restart bit that might have been set in cancelled restart |
| 169 // request. | 170 // request. |
| 171 UserManager::Hide(); |
| 170 PrefService* pref_service = g_browser_process->local_state(); | 172 PrefService* pref_service = g_browser_process->local_state(); |
| 171 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); | 173 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); |
| 172 AttemptExitInternal(false); | 174 AttemptExitInternal(false); |
| 173 #endif | 175 #endif |
| 174 } | 176 } |
| 175 | 177 |
| 176 void StartShutdownTracing() { | 178 void StartShutdownTracing() { |
| 177 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 179 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 178 if (command_line.HasSwitch(switches::kTraceShutdown)) { | 180 if (command_line.HasSwitch(switches::kTraceShutdown)) { |
| 179 base::debug::CategoryFilter category_filter( | 181 base::debug::CategoryFilter category_filter( |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // environment is still active. | 420 // environment is still active. |
| 419 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 421 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 420 return !ash::Shell::HasInstance(); | 422 return !ash::Shell::HasInstance(); |
| 421 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 423 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 422 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 424 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
| 423 #endif | 425 #endif |
| 424 return true; | 426 return true; |
| 425 } | 427 } |
| 426 | 428 |
| 427 } // namespace chrome | 429 } // namespace chrome |
| OLD | NEW |