| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Check local state for the restart flag so we can restart the session below. | 149 // Check local state for the restart flag so we can restart the session below. |
| 150 bool restart_last_session = false; | 150 bool restart_last_session = false; |
| 151 if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) { | 151 if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) { |
| 152 restart_last_session = | 152 restart_last_session = |
| 153 prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown); | 153 prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown); |
| 154 prefs->ClearPref(prefs::kRestartLastSessionOnShutdown); | 154 prefs->ClearPref(prefs::kRestartLastSessionOnShutdown); |
| 155 } | 155 } |
| 156 | 156 |
| 157 prefs->SavePersistentPrefs(); | 157 prefs->CommitPendingWrite(); |
| 158 | 158 |
| 159 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 159 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 160 // Cleanup any statics created by RLZ. Must be done before NotificationService | 160 // Cleanup any statics created by RLZ. Must be done before NotificationService |
| 161 // is destroyed. | 161 // is destroyed. |
| 162 RLZTracker::CleanupRlz(); | 162 RLZTracker::CleanupRlz(); |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 return restart_last_session; | 165 return restart_last_session; |
| 166 } | 166 } |
| 167 | 167 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 bool ShuttingDownWithoutClosingBrowsers() { | 316 bool ShuttingDownWithoutClosingBrowsers() { |
| 317 return g_shutting_down_without_closing_browsers; | 317 return g_shutting_down_without_closing_browsers; |
| 318 } | 318 } |
| 319 | 319 |
| 320 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 320 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
| 321 g_shutting_down_without_closing_browsers = without_close; | 321 g_shutting_down_without_closing_browsers = without_close; |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace browser_shutdown | 324 } // namespace browser_shutdown |
| OLD | NEW |