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

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 5600001: Clean up when Chrome is terminated and WizardController is in charge of the message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added CHECK to catch possible bugs Created 10 years 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
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/wizard_controller.cc
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 5710002692ec8e090277d9957c2d6757c326d11d..d48309d56562733978cd72f478453a72015ebe12 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -46,6 +46,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
#include "cros/chromeos_wm_ipc_enums.h"
#include "unicode/timezone.h"
@@ -266,6 +267,10 @@ WizardController::WizardController()
observer_(NULL) {
DCHECK(default_controller_ == NULL);
default_controller_ = this;
+ registrar_.Add(
+ this,
+ NotificationType::APP_TERMINATING,
+ NotificationService::AllSources());
}
WizardController::~WizardController() {
@@ -513,6 +518,18 @@ void WizardController::SkipRegistration() {
LOG(ERROR) << "Registration screen is not active.";
}
+void WizardController::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ CHECK(type == NotificationType::APP_TERMINATING);
+
+ MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ MessageLoop::current()->Quit();
+ registrar_.Remove(this,
+ NotificationType::APP_TERMINATING,
+ NotificationService::AllSources());
+}
+
// static
void WizardController::RegisterPrefs(PrefService* local_state) {
local_state->RegisterBooleanPref(kOobeComplete, false);
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698