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

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

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by mnissler. Created 9 years, 6 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/user_policy_identity_strategy.h
diff --git a/chrome/browser/policy/user_policy_identity_strategy.h b/chrome/browser/policy/user_policy_identity_strategy.h
index 4d5ecc6b1d36844f973cb7aff2e7edeb534a1e5a..f1e3f319df1e8932670da175eeb7555850a95cd2 100644
--- a/chrome/browser/policy/user_policy_identity_strategy.h
+++ b/chrome/browser/policy/user_policy_identity_strategy.h
@@ -12,27 +12,25 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/policy/cloud_policy_identity_strategy.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
-
-class Profile;
namespace policy {
class DeviceManagementBackend;
// A token provider implementation that provides a user device token for the
-// user corresponding to a given profile.
-class UserPolicyIdentityStrategy : public CloudPolicyIdentityStrategy,
- public NotificationObserver {
+// user corresponding to given credentials.
+class UserPolicyIdentityStrategy : public CloudPolicyIdentityStrategy {
public:
- UserPolicyIdentityStrategy(Profile* profile,
+ UserPolicyIdentityStrategy(const std::string& user_name,
const FilePath& token_cache_file);
virtual ~UserPolicyIdentityStrategy();
// Start loading the token cache.
void LoadTokenCache();
+ // Set a newly arriving auth_token and maybe trigger a fetch.
+ void SetAuthToken(const std::string& auth_token);
+
// CloudPolicyIdentityStrategy implementation:
virtual std::string GetDeviceToken() OVERRIDE;
virtual std::string GetDeviceID() OVERRIDE;
@@ -57,14 +55,6 @@ class UserPolicyIdentityStrategy : public CloudPolicyIdentityStrategy,
// Called from the token cache when the token has been loaded.
void OnCacheLoaded(const std::string& token, const std::string& device_id);
- // NotificationObserver method overrides:
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
- // The profile this provider is associated with.
- Profile* profile_;
-
// Keeps the on-disk copy of the token.
scoped_refptr<TokenCache> cache_;
@@ -74,8 +64,12 @@ class UserPolicyIdentityStrategy : public CloudPolicyIdentityStrategy,
// Current device token. Empty if not available.
std::string device_token_;
- // Registers the provider for notification of successful Gaia logins.
- NotificationRegistrar registrar_;
+ // Current auth token. Empty if not available.
+ std::string auth_token_;
+
+ // Current user name. Empty if not available. This is set on creation and not
+ // changed afterwards
+ std::string user_name_;
// Allows to construct weak ptrs.
base::WeakPtrFactory<UserPolicyIdentityStrategy> weak_ptr_factory_;
« no previous file with comments | « chrome/browser/policy/user_policy_cache_unittest.cc ('k') | chrome/browser/policy/user_policy_identity_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698