Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 1931503002: Add BackgroundModeOptimizer that can restart the browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PushKeepAlive
Patch Set: cleanup, enable by default (that's just to verify the tests) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 386
387 #if !defined(OS_ANDROID) 387 #if !defined(OS_ANDROID)
388 void OnAppExiting() { 388 void OnAppExiting() {
389 static bool notified = false; 389 static bool notified = false;
390 if (notified) 390 if (notified)
391 return; 391 return;
392 notified = true; 392 notified = true;
393 HandleAppExitingForPlatform(); 393 HandleAppExitingForPlatform();
394 } 394 }
395
396 void ResetRestartPrefs() {
397 PrefService* pref_service = g_browser_process->local_state();
398 if (!pref_service)
399 return;
400
401 pref_service->ClearPref(prefs::kWasRestarted);
402 pref_service->ClearPref(prefs::kRestartLastSessionOnShutdown);
403 }
395 #endif // !defined(OS_ANDROID) 404 #endif // !defined(OS_ANDROID)
396 405
397 } // namespace chrome 406 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698