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/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 32 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
33 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
35 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
36 #include "chrome/common/switch_utils.h" | 36 #include "chrome/common/switch_utils.h" |
37 #include "content/browser/browser_thread.h" | 37 #include "content/browser/browser_thread.h" |
38 #include "content/browser/plugin_process_host.h" | 38 #include "content/browser/plugin_process_host.h" |
39 #include "content/browser/renderer_host/render_process_host.h" | 39 #include "content/browser/renderer_host/render_process_host.h" |
40 #include "content/browser/renderer_host/render_view_host.h" | 40 #include "content/browser/renderer_host/render_view_host.h" |
41 #include "content/browser/renderer_host/render_widget_host.h" | 41 #include "content/browser/renderer_host/render_widget_host.h" |
42 #include "net/predictor_api.h" | |
43 #include "ui/base/resource/resource_bundle.h" | 42 #include "ui/base/resource/resource_bundle.h" |
44 | 43 |
45 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
46 #include "chrome/browser/browser_util_win.h" | 45 #include "chrome/browser/browser_util_win.h" |
47 #include "chrome/browser/first_run/upgrade_util_win.h" | 46 #include "chrome/browser/first_run/upgrade_util_win.h" |
48 #include "chrome/browser/rlz/rlz.h" | 47 #include "chrome/browser/rlz/rlz.h" |
49 #endif | 48 #endif |
50 | 49 |
51 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
52 #include "chrome/browser/chromeos/boot_times_loader.h" | 51 #include "chrome/browser/chromeos/boot_times_loader.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 133 |
135 // The XInput2 event listener needs to be shut down earlier than when | 134 // The XInput2 event listener needs to be shut down earlier than when |
136 // Singletons are finally destroyed in AtExitManager. | 135 // Singletons are finally destroyed in AtExitManager. |
137 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 136 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
138 #endif | 137 #endif |
139 | 138 |
140 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 139 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
141 // time to get here. If you have something that *must* happen on end session, | 140 // time to get here. If you have something that *must* happen on end session, |
142 // consider putting it in BrowserProcessImpl::EndSession. | 141 // consider putting it in BrowserProcessImpl::EndSession. |
143 PrefService* prefs = g_browser_process->local_state(); | 142 PrefService* prefs = g_browser_process->local_state(); |
144 ProfileManager* profile_manager = g_browser_process->profile_manager(); | |
145 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); | |
146 | |
147 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs); | |
148 | 143 |
149 PluginUpdater::GetInstance()->Shutdown(); | 144 PluginUpdater::GetInstance()->Shutdown(); |
150 | 145 |
151 MetricsService* metrics = g_browser_process->metrics_service(); | 146 MetricsService* metrics = g_browser_process->metrics_service(); |
152 if (metrics) | 147 if (metrics) |
153 metrics->RecordCompletedSessionEnd(); | 148 metrics->RecordCompletedSessionEnd(); |
154 | 149 |
155 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 150 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
156 // Record the shutdown info so that we can put it into a histogram at next | 151 // Record the shutdown info so that we can put it into a histogram at next |
157 // startup. | 152 // startup. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 321 |
327 bool ShuttingDownWithoutClosingBrowsers() { | 322 bool ShuttingDownWithoutClosingBrowsers() { |
328 #if defined(USE_X11) | 323 #if defined(USE_X11) |
329 if (GetShutdownType() == browser_shutdown::END_SESSION) | 324 if (GetShutdownType() == browser_shutdown::END_SESSION) |
330 return true; | 325 return true; |
331 #endif | 326 #endif |
332 return false; | 327 return false; |
333 } | 328 } |
334 | 329 |
335 } // namespace browser_shutdown | 330 } // namespace browser_shutdown |
OLD | NEW |