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

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

Issue 197313004: Support policy registration using a preobtained access token. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/user_policy_signin_service_ios.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/policy/cloud/user_policy_signin_service_base.h" 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 manager->core()->client()->RemoveObserver(this); 144 manager->core()->client()->RemoveObserver(this);
145 if (manager && manager->core()->service()) 145 if (manager && manager->core()->service())
146 manager->core()->service()->RemoveObserver(this); 146 manager->core()->service()->RemoveObserver(this);
147 } 147 }
148 148
149 scoped_ptr<CloudPolicyClient> 149 scoped_ptr<CloudPolicyClient>
150 UserPolicySigninServiceBase::CreateClientForRegistrationOnly( 150 UserPolicySigninServiceBase::CreateClientForRegistrationOnly(
151 const std::string& username) { 151 const std::string& username) {
152 DCHECK(!username.empty()); 152 DCHECK(!username.empty());
153 // We should not be called with a client already initialized. 153 // We should not be called with a client already initialized.
154 #if !defined(OS_IOS)
155 // On iOS we check if an account has policy while the profile is signed in
156 // to another account.
154 DCHECK(!policy_manager() || !policy_manager()->core()->client()); 157 DCHECK(!policy_manager() || !policy_manager()->core()->client());
158 #endif
155 159
156 // If the user should not get policy, just bail out. 160 // If the user should not get policy, just bail out.
157 if (!policy_manager() || !ShouldLoadPolicyForUser(username)) { 161 if (!policy_manager() || !ShouldLoadPolicyForUser(username)) {
158 DVLOG(1) << "Signed in user is not in the whitelist"; 162 DVLOG(1) << "Signed in user is not in the whitelist";
159 return scoped_ptr<CloudPolicyClient>(); 163 return scoped_ptr<CloudPolicyClient>();
160 } 164 }
161 165
162 // If the DeviceManagementService is not yet initialized, start it up now. 166 // If the DeviceManagementService is not yet initialized, start it up now.
163 device_management_service_->ScheduleInitialization(0); 167 device_management_service_->ScheduleInitialization(0);
164 168
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 263 }
260 264
261 scoped_refptr<net::URLRequestContextGetter> 265 scoped_refptr<net::URLRequestContextGetter>
262 UserPolicySigninServiceBase::CreateUserRequestContext( 266 UserPolicySigninServiceBase::CreateUserRequestContext(
263 scoped_refptr<net::URLRequestContextGetter> profile_request_context) { 267 scoped_refptr<net::URLRequestContextGetter> profile_request_context) {
264 return new UserPolicyRequestContext( 268 return new UserPolicyRequestContext(
265 profile_request_context, system_request_context(), GetUserAgent()); 269 profile_request_context, system_request_context(), GetUserAgent());
266 } 270 }
267 271
268 } // namespace policy 272 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/user_policy_signin_service_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698