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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_service.h

Issue 23494053: Remove NOTIFICATION_SYSTEM_SETTING_CHANGED, switch CrosSettings to base::CallbackRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trailing space 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/policy/device_local_account_policy_service.h
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.h b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
index ad254658752676cb355e88eddd8a153a7c1ff7c0..02b82f4de26ffff2b6532db9d5338a852df83a96 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service.h
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
@@ -14,9 +14,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/policy/cloud/cloud_policy_core.h"
#include "chrome/browser/policy/cloud/cloud_policy_store.h"
-#include "content/public/browser/notification_observer.h"
namespace base {
class SequencedTaskRunner;
@@ -75,8 +75,7 @@ class DeviceLocalAccountPolicyBroker {
// The actual policy blobs are brokered by session_manager (to prevent file
// manipulation), and we're making signature checks on the policy blobs to
// ensure they're issued by the device owner.
-class DeviceLocalAccountPolicyService : public content::NotificationObserver,
- public CloudPolicyStore::Observer {
+class DeviceLocalAccountPolicyService : public CloudPolicyStore::Observer {
public:
// Interface for interested parties to observe policy changes.
class Observer {
@@ -113,11 +112,6 @@ class DeviceLocalAccountPolicyService : public content::NotificationObserver,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
- // NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
// CloudPolicyStore::Observer:
virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE;
virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE;
@@ -151,6 +145,9 @@ class DeviceLocalAccountPolicyService : public content::NotificationObserver,
// and updates |policy_brokers_| to match that list.
void UpdateAccountList();
+ // Calls |UpdateAccountList| if there are no previous calls pending.
+ void UpdateAccountListIfNonePending();
+
// Deletes brokers in |map| and clears it.
void DeleteBrokers(PolicyBrokerMap* map);
@@ -168,6 +165,9 @@ class DeviceLocalAccountPolicyService : public content::NotificationObserver,
ObserverList<Observer, true> observers_;
+ scoped_ptr<chromeos::CrosSettings::ObserverSubscription>
+ local_accounts_subscription_;
+
// Weak pointer factory for cros_settings_->PrepareTrustedValues() callbacks.
base::WeakPtrFactory<DeviceLocalAccountPolicyService>
cros_settings_callback_factory_;

Powered by Google App Engine
This is Rietveld 408576698