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 <memory> | 7 #include <memory> |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
28 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
30 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
31 #include "chrome/browser/ui/browser_list.h" | 31 #include "chrome/browser/ui/browser_list.h" |
32 #include "chrome/browser/ui/browser_tabstrip.h" | 32 #include "chrome/browser/ui/browser_tabstrip.h" |
33 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
34 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
35 #include "chrome/browser/ui/user_manager.h" | 35 #include "chrome/browser/ui/user_manager.h" |
36 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
| 37 #include "chrome/common/features.h" |
37 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
38 #include "components/prefs/pref_service.h" | 39 #include "components/prefs/pref_service.h" |
39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/navigation_details.h" | 41 #include "content/public/browser/navigation_details.h" |
41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
42 | 43 |
43 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
44 #include "base/sys_info.h" | 45 #include "base/sys_info.h" |
45 #include "chrome/browser/chromeos/boot_times_recorder.h" | 46 #include "chrome/browser/chromeos/boot_times_recorder.h" |
46 #include "chromeos/dbus/dbus_thread_manager.h" | 47 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 CloseAllBrowsers(); | 117 CloseAllBrowsers(); |
117 } | 118 } |
118 | 119 |
119 void ShutdownIfNoBrowsers() { | 120 void ShutdownIfNoBrowsers() { |
120 if (chrome::GetTotalBrowserCount() > 0) | 121 if (chrome::GetTotalBrowserCount() > 0) |
121 return; | 122 return; |
122 | 123 |
123 // Tell everyone that we are shutting down. | 124 // Tell everyone that we are shutting down. |
124 browser_shutdown::SetTryingToQuit(true); | 125 browser_shutdown::SetTryingToQuit(true); |
125 | 126 |
126 #if defined(ENABLE_SESSION_SERVICE) | 127 #if BUILDFLAG(ENABLE_SESSION_SERVICE) |
127 // If ShuttingDownWithoutClosingBrowsers() returns true, the session | 128 // If ShuttingDownWithoutClosingBrowsers() returns true, the session |
128 // services may not get a chance to shut down normally, so explicitly shut | 129 // services may not get a chance to shut down normally, so explicitly shut |
129 // them down here to ensure they have a chance to persist their data. | 130 // them down here to ensure they have a chance to persist their data. |
130 ProfileManager::ShutdownSessionServices(); | 131 ProfileManager::ShutdownSessionServices(); |
131 #endif | 132 #endif |
132 | 133 |
133 chrome::NotifyAndTerminate(true); | 134 chrome::NotifyAndTerminate(true); |
134 chrome::OnAppExiting(); | 135 chrome::OnAppExiting(); |
135 } | 136 } |
136 | 137 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 void OnAppExiting() { | 398 void OnAppExiting() { |
398 static bool notified = false; | 399 static bool notified = false; |
399 if (notified) | 400 if (notified) |
400 return; | 401 return; |
401 notified = true; | 402 notified = true; |
402 HandleAppExitingForPlatform(); | 403 HandleAppExitingForPlatform(); |
403 } | 404 } |
404 #endif // !defined(OS_ANDROID) | 405 #endif // !defined(OS_ANDROID) |
405 | 406 |
406 } // namespace chrome | 407 } // namespace chrome |
OLD | NEW |