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

Side by Side Diff: chrome/browser/policy/browser_policy_connector.cc

Issue 10628008: If there is a device id use that instead of a new one for re-enrolling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
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 #include "chrome/browser/policy/browser_policy_connector.h" 5 #include "chrome/browser/policy/browser_policy_connector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } else { 179 } else {
180 providers.push_back(&user_cloud_policy_provider_); 180 providers.push_back(&user_cloud_policy_provider_);
181 } 181 }
182 182
183 return new PolicyServiceImpl(providers); 183 return new PolicyServiceImpl(providers);
184 } 184 }
185 185
186 void BrowserPolicyConnector::RegisterForDevicePolicy( 186 void BrowserPolicyConnector::RegisterForDevicePolicy(
187 const std::string& owner_email, 187 const std::string& owner_email,
188 const std::string& token, 188 const std::string& token,
189 bool known_machine_id) { 189 bool known_machine_id,
190 bool reregister) {
190 #if defined(OS_CHROMEOS) 191 #if defined(OS_CHROMEOS)
191 if (device_data_store_.get()) { 192 if (device_data_store_.get()) {
192 if (!device_data_store_->device_token().empty()) { 193 if (!device_data_store_->device_token().empty()) {
193 LOG(ERROR) << "Device policy data store already has a DMToken; " 194 LOG(ERROR) << "Device policy data store already has a DMToken; "
194 << "RegisterForDevicePolicy won't trigger a new registration."; 195 << "RegisterForDevicePolicy won't trigger a new registration.";
195 } 196 }
197
196 device_data_store_->set_user_name(owner_email); 198 device_data_store_->set_user_name(owner_email);
197 device_data_store_->set_known_machine_id(known_machine_id); 199 device_data_store_->set_known_machine_id(known_machine_id);
200 if (reregister) {
201 device_data_store_->set_device_id(install_attributes_->GetDeviceId());
202 device_data_store_->set_reregister(true);
203 }
198 device_data_store_->set_policy_fetching_enabled(false); 204 device_data_store_->set_policy_fetching_enabled(false);
199 device_data_store_->SetOAuthToken(token); 205 device_data_store_->SetOAuthToken(token);
200 } 206 }
201 #endif 207 #endif
202 } 208 }
203 209
204 bool BrowserPolicyConnector::IsEnterpriseManaged() { 210 bool BrowserPolicyConnector::IsEnterpriseManaged() {
205 #if defined(OS_CHROMEOS) 211 #if defined(OS_CHROMEOS)
206 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); 212 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice();
207 #else 213 #else
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 return new AsyncPolicyProvider(loader.Pass()); 577 return new AsyncPolicyProvider(loader.Pass());
572 } else { 578 } else {
573 return NULL; 579 return NULL;
574 } 580 }
575 #else 581 #else
576 return NULL; 582 return NULL;
577 #endif 583 #endif
578 } 584 }
579 585
580 } // namespace policy 586 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.h ('k') | chrome/browser/policy/cloud_policy_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698