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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_client_registration_helper.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 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 COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HEL PER_H_ 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HEL PER_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HEL PER_H_ 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_HEL PER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const std::string& account_id, 49 const std::string& account_id,
50 const base::Closure& callback); 50 const base::Closure& callback);
51 51
52 #if !defined(OS_ANDROID) 52 #if !defined(OS_ANDROID)
53 // Starts the client registration process. The |login_refresh_token| is used 53 // Starts the client registration process. The |login_refresh_token| is used
54 // to mint a new token for the userinfo and DM services. 54 // to mint a new token for the userinfo and DM services.
55 // |callback| is invoked when the registration is complete. 55 // |callback| is invoked when the registration is complete.
56 void StartRegistrationWithLoginToken(const std::string& login_refresh_token, 56 void StartRegistrationWithLoginToken(const std::string& login_refresh_token,
57 const base::Closure& callback); 57 const base::Closure& callback);
58 58
59 // Starts the client registration process. |access_token| must be a valid
60 // OAuth access token for the scopes returned by the |GetScopes| static
61 // function.
62 void StartRegistrationWithAccessToken(const std::string& access_token,
63 const base::Closure& callback);
64
65 // Returns the scopes required for policy client registration. 59 // Returns the scopes required for policy client registration.
66 static std::vector<std::string> GetScopes(); 60 static std::vector<std::string> GetScopes();
67 #endif 61 #endif
68 62
69 private: 63 private:
70 class TokenServiceHelper; 64 class TokenServiceHelper;
71 #if !defined(OS_ANDROID) 65 #if !defined(OS_ANDROID)
72 class LoginTokenHelper; 66 class LoginTokenHelper;
73 #endif 67 #endif
74 68
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 CloudPolicyClient* client_; 105 CloudPolicyClient* client_;
112 enterprise_management::DeviceRegisterRequest::Type registration_type_; 106 enterprise_management::DeviceRegisterRequest::Type registration_type_;
113 base::Closure callback_; 107 base::Closure callback_;
114 108
115 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClientRegistrationHelper); 109 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClientRegistrationHelper);
116 }; 110 };
117 111
118 } // namespace policy 112 } // namespace policy
119 113
120 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_ HELPER_H_ 114 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_REGISTRATION_ HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698