Chromium Code Reviews| 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_; |