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

Unified Diff: chrome/browser/policy/cloud_policy_identity_strategy.h

Issue 7298012: Consolidate data storage and notifications in the cloud policy subsystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 5 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/policy/cloud_policy_identity_strategy.h
diff --git a/chrome/browser/policy/cloud_policy_identity_strategy.h b/chrome/browser/policy/cloud_policy_identity_strategy.h
deleted file mode 100644
index 0b4e213bbb0aee3c4e1da5aede0d85f0bfdf7289..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/cloud_policy_identity_strategy.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_
-#define CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_
-#pragma once
-
-#include <string>
-
-#include "base/observer_list.h"
-#include "chrome/browser/policy/proto/device_management_backend.pb.h"
-
-namespace policy {
-
-namespace em = enterprise_management;
-
-// Manages a device management token, i.e. an identifier that represents a
-// registration with the device management service, and the associated
-// credentials. Responsibilities include storing and loading the token from
-// disk, observing and triggering relevant notifications.
-class CloudPolicyIdentityStrategy {
- public:
- class Observer {
- public:
- virtual ~Observer() {}
-
- // Notifies observers that the effective token for fetching policy has
- // changed. The token can be queried by calling GetDeviceToken().
- virtual void OnDeviceTokenChanged() = 0;
-
- // Authentication credentials for talking to the device management service
- // changed. New auth data is available through GetCredentials().
- virtual void OnCredentialsChanged() = 0;
- };
-
- CloudPolicyIdentityStrategy();
- virtual ~CloudPolicyIdentityStrategy();
-
- void AddObserver(Observer* obs);
- void RemoveObserver(Observer* obs);
-
- // Returns the device management token, if available. Returns the empty string
- // if the device token is currently unavailable.
- virtual std::string GetDeviceToken() = 0;
-
- // Returns the device ID for this device. This is a unique identifier that is
- // randomly generated at registration time on the client side. It always has
- // to be sent along with the device token to the server.
- virtual std::string GetDeviceID() = 0;
-
- // Returns physical machine ID for this device.
- virtual std::string GetMachineID() = 0;
-
- // Returns physical machine model for this device.
- virtual std::string GetMachineModel() = 0;
-
- // Returns the policy type to be used for registering at the device management
- // server.
- virtual em::DeviceRegisterRequest_Type GetPolicyRegisterType() = 0;
-
- // Returns the policy type to be used for requesting policies from the device
- // management server.
- virtual std::string GetPolicyType() = 0;
-
- // Retrieves authentication credentials to use when talking to the device
- // management service. Returns true if the data is available and writes the
- // values to the provided pointers.
- virtual bool GetCredentials(std::string* username,
- std::string* auth_token) = 0;
-
- // Notifies the identity strategy that a new token has been fetched. It is up
- // to the identity strategy to store the token, decide whether it is going
- // to be used, send out an appropriate OnDeviceTokenChanged() notification
- // and return the new token in GetDeviceToken() calls.
- virtual void OnDeviceTokenAvailable(const std::string& token) = 0;
-
- protected:
- // Notify observers that the effective token has changed.
- void NotifyDeviceTokenChanged();
-
- // Notify observers about authentication data change.
- void NotifyAuthChanged();
-
- private:
- ObserverList<Observer, true> observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(CloudPolicyIdentityStrategy);
-};
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_IDENTITY_STRATEGY_H_
« no previous file with comments | « chrome/browser/policy/cloud_policy_data_store.cc ('k') | chrome/browser/policy/cloud_policy_identity_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698