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

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

Issue 2953253002: [DICE] Enable sync for an account that is already present in the token service. (Closed)
Patch Set: Address code review Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 29 matching lines...) Expand all
40 SigninManager* signin_manager, 40 SigninManager* signin_manager,
41 scoped_refptr<net::URLRequestContextGetter> system_request_context, 41 scoped_refptr<net::URLRequestContextGetter> system_request_context,
42 ProfileOAuth2TokenService* oauth2_token_service); 42 ProfileOAuth2TokenService* oauth2_token_service);
43 ~UserPolicySigninService() override; 43 ~UserPolicySigninService() override;
44 44
45 // Registers a CloudPolicyClient for fetching policy for a user. The 45 // Registers a CloudPolicyClient for fetching policy for a user. The
46 // |oauth2_login_token| and |username| are explicitly passed because 46 // |oauth2_login_token| and |username| are explicitly passed because
47 // the user is not signed in yet (ProfileOAuth2TokenService does not have 47 // the user is not signed in yet (ProfileOAuth2TokenService does not have
48 // any tokens yet to prevent services from using it until after we've fetched 48 // any tokens yet to prevent services from using it until after we've fetched
49 // policy). 49 // policy).
50 void RegisterForPolicy(const std::string& username, 50 void RegisterForPolicyWithLoginToken(
51 const std::string& oauth2_login_token, 51 const std::string& username,
52 const PolicyRegistrationCallback& callback); 52 const std::string& oauth2_login_token,
53 const PolicyRegistrationCallback& callback);
54
55 // Registers a CloudPolicyClient for fetching policy for a user. |username| is
56 // explicitly passed because the user is not yet authenticated, but the token
57 // service has a refresh token available for |account_id|.
58 void RegisterForPolicyWithAccountId(
59 const std::string& username,
60 const std::string& account_id,
61 const PolicyRegistrationCallback& callback);
53 62
54 // OAuth2TokenService::Observer implementation: 63 // OAuth2TokenService::Observer implementation:
55 void OnRefreshTokenAvailable(const std::string& account_id) override; 64 void OnRefreshTokenAvailable(const std::string& account_id) override;
56 65
57 // CloudPolicyService::Observer implementation: 66 // CloudPolicyService::Observer implementation:
58 void OnInitializationCompleted(CloudPolicyService* service) override; 67 void OnInitializationCompleted(CloudPolicyService* service) override;
59 68
60 // KeyedService implementation: 69 // KeyedService implementation:
61 void Shutdown() override; 70 void Shutdown() override;
62 71
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Weak pointer to the token service we use to authenticate during 104 // Weak pointer to the token service we use to authenticate during
96 // CloudPolicyClient registration. 105 // CloudPolicyClient registration.
97 ProfileOAuth2TokenService* oauth2_token_service_; 106 ProfileOAuth2TokenService* oauth2_token_service_;
98 107
99 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService); 108 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninService);
100 }; 109 };
101 110
102 } // namespace policy 111 } // namespace policy
103 112
104 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_H_ 113 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/signin/signin_manager_android.cc ('k') | chrome/browser/policy/cloud/user_policy_signin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698