| 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/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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 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/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
| 39 #include "content/public/browser/render_view_host.h" | 39 #include "content/public/browser/render_view_host.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 41 | 41 |
| 42 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
| 43 #include "chrome/browser/browser_util_win.h" | 43 #include "chrome/browser/browser_util_win.h" |
| 44 #include "chrome/browser/first_run/upgrade_util_win.h" | 44 #include "chrome/browser/first_run/upgrade_util_win.h" |
| 45 #endif |
| 46 |
| 47 #if defined(ENABLE_RLZ) |
| 45 #include "chrome/browser/rlz/rlz.h" | 48 #include "chrome/browser/rlz/rlz.h" |
| 46 #endif | 49 #endif |
| 47 | 50 |
| 48 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 49 #include "chrome/browser/chromeos/boot_times_loader.h" | 52 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 50 #include "chrome/browser/chromeos/cros/cros_library.h" | 53 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 51 #endif | 54 #endif |
| 52 | 55 |
| 53 using base::Time; | 56 using base::Time; |
| 54 using base::TimeDelta; | 57 using base::TimeDelta; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Check local state for the restart flag so we can restart the session below. | 151 // Check local state for the restart flag so we can restart the session below. |
| 149 bool restart_last_session = false; | 152 bool restart_last_session = false; |
| 150 if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) { | 153 if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) { |
| 151 restart_last_session = | 154 restart_last_session = |
| 152 prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown); | 155 prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown); |
| 153 prefs->ClearPref(prefs::kRestartLastSessionOnShutdown); | 156 prefs->ClearPref(prefs::kRestartLastSessionOnShutdown); |
| 154 } | 157 } |
| 155 | 158 |
| 156 prefs->CommitPendingWrite(); | 159 prefs->CommitPendingWrite(); |
| 157 | 160 |
| 158 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 161 #if defined(ENABLE_RLZ) |
| 159 // Cleanup any statics created by RLZ. Must be done before NotificationService | 162 // Cleanup any statics created by RLZ. Must be done before NotificationService |
| 160 // is destroyed. | 163 // is destroyed. |
| 161 RLZTracker::CleanupRlz(); | 164 RLZTracker::CleanupRlz(); |
| 162 #endif | 165 #endif |
| 163 | 166 |
| 164 return restart_last_session; | 167 return restart_last_session; |
| 165 } | 168 } |
| 166 | 169 |
| 167 void ShutdownPostThreadsStop(bool restart_last_session) { | 170 void ShutdownPostThreadsStop(bool restart_last_session) { |
| 168 // The jank'o'meter requires that the browser process has been destroyed | 171 // The jank'o'meter requires that the browser process has been destroyed |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 317 |
| 315 bool ShuttingDownWithoutClosingBrowsers() { | 318 bool ShuttingDownWithoutClosingBrowsers() { |
| 316 return g_shutting_down_without_closing_browsers; | 319 return g_shutting_down_without_closing_browsers; |
| 317 } | 320 } |
| 318 | 321 |
| 319 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 322 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
| 320 g_shutting_down_without_closing_browsers = without_close; | 323 g_shutting_down_without_closing_browsers = without_close; |
| 321 } | 324 } |
| 322 | 325 |
| 323 } // namespace browser_shutdown | 326 } // namespace browser_shutdown |
| OLD | NEW |