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

Unified Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 1376063005: Cleanup: Pull some browser keep alive functions into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/ui/login_display_host_impl.cc
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
index f3d283e9076129a5e4c7e65951365ef35b6a9793..7568662754a778499ed99eb9b58f8d4fe57ae660 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
@@ -55,6 +55,7 @@
#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/chromeos/ui/focus_ring_controller.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/lifetime/browser_keep_alive.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/common/chrome_constants.h"
@@ -307,7 +308,7 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds)
default_host_ = this;
// Make sure chrome won't exit while we are at login/oobe screen.
- chrome::IncrementKeepAliveCount();
+ keep_alive_.reset(new browser_lifetime::ScopedKeepAlive);
bool is_registered = StartupUtils::IsDeviceRegistered();
bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
@@ -397,7 +398,7 @@ LoginDisplayHostImpl::~LoginDisplayHostImpl() {
ResetLoginWindowAndView();
// Let chrome process exit after login/oobe screen if needed.
- chrome::DecrementKeepAliveCount();
+ keep_alive_.reset();
sky 2015/10/07 17:27:24 As this is the destructor you shouldn't need the e
default_host_ = NULL;
// TODO(tengs): This should be refactored. See crbug.com/314934.

Powered by Google App Engine
This is Rietveld 408576698