Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 27 matching lines...) Expand all Loading... | |
| 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 // |callback| is invoked once we have registered this device to fetch policy, | 47 // |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. | 48 // or once it is determined that |username| is not a managed account. |
|
Roger Tawa OOO till Jul 10th
2015/08/12 15:28:47
Please add documentation for |account_id| arg.
gogerald1
2015/08/13 18:12:12
Done.
| |
| 49 void RegisterForPolicy(const std::string& username, | 49 void RegisterForPolicy(const std::string& username, |
| 50 const std::string& accountId, | |
| 50 const PolicyRegistrationCallback& callback); | 51 const PolicyRegistrationCallback& callback); |
| 51 | 52 |
| 52 #if !defined(OS_ANDROID) | 53 #if !defined(OS_ANDROID) |
| 53 // Registers a CloudPolicyClient for fetching policy for |username|. | 54 // Registers a CloudPolicyClient for fetching policy for |username|. |
| 54 // This requires a valid OAuth access token for the scopes returned by the | 55 // This requires a valid OAuth access token for the scopes returned by the |
| 55 // |GetScopes| static function. |callback| is invoked once we have | 56 // |GetScopes| static function. |callback| is invoked once we have |
| 56 // registered this device to fetch policy, or once it is determined that | 57 // registered this device to fetch policy, or once it is determined that |
| 57 // |username| is not a managed account. | 58 // |username| is not a managed account. |
| 58 void RegisterForPolicyWithAccessToken( | 59 void RegisterForPolicyWithAccessToken( |
| 59 const std::string& username, | 60 const std::string& username, |
| 60 const std::string& access_token, | 61 const std::string& access_token, |
| 61 const PolicyRegistrationCallback& callback); | 62 const PolicyRegistrationCallback& callback); |
| 62 | 63 |
| 63 // Returns the list of OAuth access scopes required for policy fetching. | 64 // Returns the list of OAuth access scopes required for policy fetching. |
| 64 static std::vector<std::string> GetScopes(); | 65 static std::vector<std::string> GetScopes(); |
| 65 #endif | 66 #endif |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 void RegisterForPolicyInternal( | 69 void RegisterForPolicyInternal(const std::string& username, |
| 69 const std::string& username, | 70 const std::string& accountId, |
|
Roger Tawa OOO till Jul 10th
2015/08/12 15:28:47
Use account_id. Also in cc file. Also above func
gogerald1
2015/08/13 18:12:12
Done.
| |
| 70 const std::string& access_token, | 71 const std::string& access_token, |
| 71 const PolicyRegistrationCallback& callback); | 72 const PolicyRegistrationCallback& callback); |
| 72 | 73 |
| 73 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client, | 74 void CallPolicyRegistrationCallback(scoped_ptr<CloudPolicyClient> client, |
| 74 PolicyRegistrationCallback callback); | 75 PolicyRegistrationCallback callback); |
| 75 | 76 |
| 76 // KeyedService implementation: | 77 // KeyedService implementation: |
| 77 void Shutdown() override; | 78 void Shutdown() override; |
| 78 | 79 |
| 79 // CloudPolicyService::Observer implementation: | 80 // CloudPolicyService::Observer implementation: |
| 80 void OnInitializationCompleted(CloudPolicyService* service) override; | 81 void OnInitializationCompleted(CloudPolicyService* service) override; |
| 81 | 82 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 101 PrefService* profile_prefs_; | 102 PrefService* profile_prefs_; |
| 102 | 103 |
| 103 base::WeakPtrFactory<UserPolicySigninService> weak_factory_; | 104 base::WeakPtrFactory<UserPolicySigninService> weak_factory_; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); | 106 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace policy | 109 } // namespace policy |
| 109 | 110 |
| 110 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_ | 111 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_MOBILE_H_ |
| OLD | NEW |