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

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

Issue 1256283002: GAIA ID migration for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_MOBILE_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 26 matching lines...) Expand all
37 DeviceManagementService* device_management_service, 37 DeviceManagementService* device_management_service,
38 UserCloudPolicyManager* policy_manager, 38 UserCloudPolicyManager* policy_manager,
39 SigninManager* signin_manager, 39 SigninManager* signin_manager,
40 scoped_refptr<net::URLRequestContextGetter> system_request_context, 40 scoped_refptr<net::URLRequestContextGetter> system_request_context,
41 ProfileOAuth2TokenService* token_service); 41 ProfileOAuth2TokenService* token_service);
42 ~UserPolicySigninService() override; 42 ~UserPolicySigninService() override;
43 43
44 // Registers a CloudPolicyClient for fetching policy for |username|. 44 // Registers a CloudPolicyClient for fetching policy for |username|.
45 // This requests an OAuth2 token for the services involved, and contacts 45 // This requests an OAuth2 token for the services involved, and contacts
46 // the policy service if the account has management enabled. 46 // the policy service if the account has management enabled.
47 // |account_id| is the obfuscated identitifcation of |username| to get OAuth2
48 // token services.
47 // |callback| is invoked once we have registered this device to fetch policy, 49 // |callback| is invoked once we have registered this device to fetch policy,
48 // or once it is determined that |username| is not a managed account. 50 // or once it is determined that |username| is not a managed account.
49 void RegisterForPolicy(const std::string& username, 51 void RegisterForPolicy(const std::string& username,
52 const std::string& account_id,
50 const PolicyRegistrationCallback& callback); 53 const PolicyRegistrationCallback& callback);
51 54
52 #if !defined(OS_ANDROID) 55 #if !defined(OS_ANDROID)
53 // Registers a CloudPolicyClient for fetching policy for |username|. 56 // Registers a CloudPolicyClient for fetching policy for |username|.
54 // This requires a valid OAuth access token for the scopes returned by the 57 // This requires a valid OAuth access token for the scopes returned by the
55 // |GetScopes| static function. |callback| is invoked once we have 58 // |GetScopes| static function. |callback| is invoked once we have
56 // registered this device to fetch policy, or once it is determined that 59 // registered this device to fetch policy, or once it is determined that
57 // |username| is not a managed account. 60 // |username| is not a managed account.
58 void RegisterForPolicyWithAccessToken( 61 void RegisterForPolicyWithAccessToken(
59 const std::string& username, 62 const std::string& username,
60 const std::string& access_token, 63 const std::string& access_token,
61 const PolicyRegistrationCallback& callback); 64 const PolicyRegistrationCallback& callback);
62 65
63 // Returns the list of OAuth access scopes required for policy fetching. 66 // Returns the list of OAuth access scopes required for policy fetching.
64 static std::vector<std::string> GetScopes(); 67 static std::vector<std::string> GetScopes();
65 #endif 68 #endif
66 69
67 private: 70 private:
68 void RegisterForPolicyInternal( 71 void RegisterForPolicyInternal(const std::string& username,
69 const std::string& username, 72 const std::string& account_id,
70 const std::string& access_token, 73 const std::string& access_token,
71 const PolicyRegistrationCallback& callback); 74 const PolicyRegistrationCallback& callback);
72 75
73 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client, 76 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client,
74 PolicyRegistrationCallback callback); 77 PolicyRegistrationCallback callback);
75 78
76 // KeyedService implementation: 79 // KeyedService implementation:
77 void Shutdown() override; 80 void Shutdown() override;
78 81
79 // CloudPolicyService::Observer implementation: 82 // CloudPolicyService::Observer implementation:
80 void OnInitializationCompleted(CloudPolicyService* service) override; 83 void OnInitializationCompleted(CloudPolicyService* service) override;
81 84
(...skipping 19 matching lines...) Expand all
101 PrefService* profile_prefs_; 104 PrefService* profile_prefs_;
102 105
103 base::WeakPtrFactory<UserPolicySigninService> weak_factory_; 106 base::WeakPtrFactory<UserPolicySigninService> weak_factory_;
104 107
105 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); 108 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService);
106 }; 109 };
107 110
108 } // namespace policy 111 } // namespace policy
109 112
110 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_ 113 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698