| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 #endif | 140 #endif |
| 141 #endif | 141 #endif |
| 142 | 142 |
| 143 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 143 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
| 144 // time to get here. If you have something that *must* happen on end session, | 144 // time to get here. If you have something that *must* happen on end session, |
| 145 // consider putting it in BrowserProcessImpl::EndSession. | 145 // consider putting it in BrowserProcessImpl::EndSession. |
| 146 PrefService* prefs = g_browser_process->local_state(); | 146 PrefService* prefs = g_browser_process->local_state(); |
| 147 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 147 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 148 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); | 148 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs(); |
| 149 | 149 |
| 150 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs); | |
| 151 | |
| 152 PluginUpdater::GetInstance()->Shutdown(); | 150 PluginUpdater::GetInstance()->Shutdown(); |
| 153 | 151 |
| 154 MetricsService* metrics = g_browser_process->metrics_service(); | 152 MetricsService* metrics = g_browser_process->metrics_service(); |
| 155 if (metrics) | 153 if (metrics) |
| 156 metrics->RecordCompletedSessionEnd(); | 154 metrics->RecordCompletedSessionEnd(); |
| 157 | 155 |
| 158 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 156 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
| 159 // Record the shutdown info so that we can put it into a histogram at next | 157 // Record the shutdown info so that we can put it into a histogram at next |
| 160 // startup. | 158 // startup. |
| 161 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); | 159 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 335 |
| 338 bool ShuttingDownWithoutClosingBrowsers() { | 336 bool ShuttingDownWithoutClosingBrowsers() { |
| 339 #if defined(USE_X11) | 337 #if defined(USE_X11) |
| 340 if (GetShutdownType() == browser_shutdown::END_SESSION) | 338 if (GetShutdownType() == browser_shutdown::END_SESSION) |
| 341 return true; | 339 return true; |
| 342 #endif | 340 #endif |
| 343 return false; | 341 return false; |
| 344 } | 342 } |
| 345 | 343 |
| 346 } // namespace browser_shutdown | 344 } // namespace browser_shutdown |
| OLD | NEW |