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

Unified Diff: chrome/browser/chromeos/attestation/attestation_policy_observer.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: 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/attestation/attestation_policy_observer.h
diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer.h b/chrome/browser/chromeos/attestation/attestation_policy_observer.h
index 1f789717d24bb5d5c84035a898fdefb5163c80c7..2566487776ce2af277e684ef58f789dc79cd83ab 100644
--- a/chrome/browser/chromeos/attestation/attestation_policy_observer.h
+++ b/chrome/browser/chromeos/attestation/attestation_policy_observer.h
@@ -11,7 +11,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "content/public/browser/notification_observer.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
namespace policy {
class CloudPolicyClient;
@@ -28,7 +28,7 @@ class AttestationFlow;
// A class which observes policy changes and triggers device attestation work if
// necessary.
-class AttestationPolicyObserver : public content::NotificationObserver {
+class AttestationPolicyObserver {
public:
// The observer immediately connects with CrosSettings to listen for policy
// changes. The CloudPolicyClient is used to upload the device certificate to
@@ -45,17 +45,15 @@ class AttestationPolicyObserver : public content::NotificationObserver {
virtual ~AttestationPolicyObserver();
Lei Zhang 2013/09/18 05:00:53 no longer needs to be virtual?
Avi (use Gerrit) 2013/09/18 16:41:44 Done.
- // content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
// Sets the retry delay in seconds; useful in testing.
void set_retry_delay(int retry_delay) {
retry_delay_ = retry_delay;
}
private:
+ // Called when the attestation setting changes.
+ void AttestationSettingChanged();
+
// Checks attestation policy and starts any necessary work.
void Start();
@@ -98,6 +96,8 @@ class AttestationPolicyObserver : public content::NotificationObserver {
int num_retries_;
int retry_delay_;
+ scoped_ptr<CrosSettings::ObserverSubscription> attestation_subscription_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed.
base::WeakPtrFactory<AttestationPolicyObserver> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698