Chromium Code Reviews| Index: chrome/browser/ui/browser_init.cc |
| diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc |
| index 6d2bc1e91253e745a9393e2ae0cc8bf898564206..ec1b6691da43dfa415d03538b710bd8fdfc573a3 100644 |
| --- a/chrome/browser/ui/browser_init.cc |
| +++ b/chrome/browser/ui/browser_init.cc |
| @@ -498,9 +498,6 @@ void RegisterComponentsForUpdate(const CommandLine& command_line) { |
| // BrowserInit ---------------------------------------------------------------- |
| -bool BrowserInit::was_restarted_ = false; |
| -bool BrowserInit::was_restarted_read_ = false; |
| - |
| BrowserInit::BrowserInit() {} |
| BrowserInit::~BrowserInit() {} |
| @@ -589,6 +586,12 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line, |
| // static |
| bool BrowserInit::WasRestarted() { |
| + // Stores the value of the preference kWasRestarted had when it was read. |
| + static bool was_restarted_ = false; |
|
sky
2011/12/14 15:22:21
Since you're moving these to locals, don't end the
marja
2011/12/15 09:21:32
Done.
|
| + |
| + // True if we have already read and reset the preference kWasRestarted. |
| + static bool was_restarted_read_ = false; |
| + |
| if (!was_restarted_read_) { |
| PrefService* pref_service = g_browser_process->local_state(); |
| was_restarted_ = pref_service->GetBoolean(prefs::kWasRestarted); |