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

Unified Diff: chrome/browser/chromeos/settings/device_settings_service.h

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed DeviceOAuth2TokenServiceTest.* unit_tests. Created 6 years, 7 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/settings/device_settings_service.h
diff --git a/chrome/browser/chromeos/settings/device_settings_service.h b/chrome/browser/chromeos/settings/device_settings_service.h
index 5b055135ae86503a54bffa83d30985115b7f5214..e6714d0bb055e28813b87400cbfb927f9ab8ad0f 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.h
+++ b/chrome/browser/chromeos/settings/device_settings_service.h
@@ -19,6 +19,8 @@
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/tpm_token_loader.h"
#include "components/policy/core/common/cloud/cloud_policy_validator.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "policy/proto/device_management_backend.pb.h"
namespace crypto {
@@ -79,7 +81,8 @@ class OwnerKey : public base::RefCountedThreadSafe<OwnerKey> {
// DeviceSettingsService generates notifications for key and policy update
// events so interested parties can reload state as appropriate.
class DeviceSettingsService : public SessionManagerClient::Observer,
- public TPMTokenLoader::Observer {
+ public TPMTokenLoader::Observer,
+ public content::NotificationObserver {
public:
// Indicates ownership status of the device.
enum OwnershipStatus {
@@ -214,6 +217,11 @@ class DeviceSettingsService : public SessionManagerClient::Observer,
// TPMTokenLoader::Observer:
virtual void OnTPMTokenReady() OVERRIDE;
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
// Enqueues a new operation. Takes ownership of |operation| and starts it
// right away if there is no active operation currently.
@@ -280,6 +288,8 @@ class DeviceSettingsService : public SessionManagerClient::Observer,
// For recoverable load errors how many retries are left before we give up.
int load_retries_left_;
+ content::NotificationRegistrar registrar_;
+
base::WeakPtrFactory<DeviceSettingsService> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DeviceSettingsService);

Powered by Google App Engine
This is Rietveld 408576698