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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_app_manager.cc

Issue 23494053: Remove NOTIFICATION_SYSTEM_SETTING_CHANGED, switch CrosSettings to base::CallbackRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 7 years, 3 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/app_mode/kiosk_app_manager.cc
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
index c9e4ef8c9a2a698cc2b99f2b39b0143d0d658bb6..4e3bcebc2ccc3394a3652833c5fb88bf05dbac77 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
@@ -314,19 +314,21 @@ void KioskAppManager::RemoveObserver(KioskAppManagerObserver* observer) {
KioskAppManager::KioskAppManager() : ownership_established_(false) {
UpdateAppData();
- CrosSettings::Get()->AddSettingsObserver(
- kAccountsPrefDeviceLocalAccounts, this);
- CrosSettings::Get()->AddSettingsObserver(
- kAccountsPrefDeviceLocalAccountAutoLoginId, this);
+ local_accounts_subscription_ =
+ CrosSettings::Get()->AddSettingsObserver(
+ kAccountsPrefDeviceLocalAccounts,
+ base::Bind(&KioskAppManager::UpdateAppData, base::Unretained(this)));
+ local_account_auto_login_id_subscription_ =
+ CrosSettings::Get()->AddSettingsObserver(
+ kAccountsPrefDeviceLocalAccountAutoLoginId,
+ base::Bind(&KioskAppManager::UpdateAppData, base::Unretained(this)));
}
KioskAppManager::~KioskAppManager() {}
void KioskAppManager::CleanUp() {
- CrosSettings::Get()->RemoveSettingsObserver(
- kAccountsPrefDeviceLocalAccounts, this);
- CrosSettings::Get()->RemoveSettingsObserver(
- kAccountsPrefDeviceLocalAccountAutoLoginId, this);
+ local_accounts_subscription_.reset();
+ local_account_auto_login_id_subscription_.reset();
apps_.clear();
}
@@ -394,13 +396,6 @@ void KioskAppManager::UpdateAppData() {
OnKioskAppsSettingsChanged());
}
-void KioskAppManager::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED, type);
- UpdateAppData();
-}
-
void KioskAppManager::GetKioskAppIconCacheDir(base::FilePath* cache_dir) {
base::FilePath user_data_dir;
CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));

Powered by Google App Engine
This is Rietveld 408576698