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

Side by Side Diff: chrome/browser/policy/cloud/user_policy_signin_service_base.h

Issue 23068005: Convert UserPolicySigninService to use OAuth2TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed code review feedback. Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // signs-in and an OAuth2 login refresh token becomes available. 109 // signs-in and an OAuth2 login refresh token becomes available.
110 void InitializeForSignedInUser(const std::string& username); 110 void InitializeForSignedInUser(const std::string& username);
111 111
112 // Initializes the cloud policy manager with the passed |client|. This is 112 // Initializes the cloud policy manager with the passed |client|. This is
113 // called from InitializeForSignedInUser() when the Profile already has a 113 // called from InitializeForSignedInUser() when the Profile already has a
114 // signed in account at startup, and from FetchPolicyForSignedInUser() during 114 // signed in account at startup, and from FetchPolicyForSignedInUser() during
115 // the initial policy fetch after signing in. 115 // the initial policy fetch after signing in.
116 virtual void InitializeUserCloudPolicyManager( 116 virtual void InitializeUserCloudPolicyManager(
117 scoped_ptr<CloudPolicyClient> client); 117 scoped_ptr<CloudPolicyClient> client);
118 118
119 // Prepares for the UserCloudPolicyManager to be shutdown due to
120 // user signout or profile destruction.
121 virtual void PrepareForUserCloudPolicyManagerShutdown();
122
119 // Shuts down the UserCloudPolicyManager (for example, after the user signs 123 // Shuts down the UserCloudPolicyManager (for example, after the user signs
120 // out) and deletes any cached policy. 124 // out) and deletes any cached policy.
121 virtual void ShutdownUserCloudPolicyManager(); 125 virtual void ShutdownUserCloudPolicyManager();
122 126
123 // Convenience helper to get the UserCloudPolicyManager for |profile_|. 127 // Convenience helper to get the UserCloudPolicyManager for |profile_|.
124 UserCloudPolicyManager* GetManager(); 128 UserCloudPolicyManager* GetManager();
125 129
126 Profile* profile() { return profile_; } 130 Profile* profile() { return profile_; }
127 content::NotificationRegistrar* registrar() { return &registrar_; } 131 content::NotificationRegistrar* registrar() { return &registrar_; }
128 132
129 private: 133 private:
130 // Weak pointer to the profile this service is associated with. 134 // Weak pointer to the profile this service is associated with.
131 Profile* profile_; 135 Profile* profile_;
132 136
133 content::NotificationRegistrar registrar_; 137 content::NotificationRegistrar registrar_;
134 138
135 PrefService* local_state_; 139 PrefService* local_state_;
136 DeviceManagementService* device_management_service_; 140 DeviceManagementService* device_management_service_;
137 141
138 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_; 142 base::WeakPtrFactory<UserPolicySigninServiceBase> weak_factory_;
139 143
140 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase); 144 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceBase);
141 }; 145 };
142 146
143 } // namespace policy 147 } // namespace policy
144 148
145 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_ 149 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698