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

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

Issue 10661027: Remove TODOs from the code in accordance with the decision to not change the default enrollment typ… (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
« no previous file with comments | « no previous file | chrome/browser/policy/device_token_fetcher_unittest.cc » ('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 (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/device_token_fetcher.h" 5 #include "chrome/browser/policy/device_token_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 switch (status) { 201 switch (status) {
202 case DM_STATUS_SUCCESS: { 202 case DM_STATUS_SUCCESS: {
203 const em::DeviceRegisterResponse& register_response = 203 const em::DeviceRegisterResponse& register_response =
204 response.register_response(); 204 response.register_response();
205 if (register_response.has_device_management_token()) { 205 if (register_response.has_device_management_token()) {
206 UMA_HISTOGRAM_ENUMERATION(kMetricToken, kMetricTokenFetchOK, 206 UMA_HISTOGRAM_ENUMERATION(kMetricToken, kMetricTokenFetchOK,
207 kMetricTokenSize); 207 kMetricTokenSize);
208 208
209 if (data_store_->policy_register_type() == 209 if (data_store_->policy_register_type() ==
210 em::DeviceRegisterRequest::DEVICE) { 210 em::DeviceRegisterRequest::DEVICE) {
211 // TODO(pastarmovj): Default to DEVICE_MODE_UNKNOWN once DM server has
212 // been updated. http://crosbug.com/26624
213 DeviceMode mode = DEVICE_MODE_ENTERPRISE; 211 DeviceMode mode = DEVICE_MODE_ENTERPRISE;
214 if (register_response.has_enrollment_type()) { 212 if (register_response.has_enrollment_type()) {
215 mode = TranslateProtobufDeviceMode( 213 mode = TranslateProtobufDeviceMode(
216 register_response.enrollment_type()); 214 register_response.enrollment_type());
217 } 215 }
218 if (mode == DEVICE_MODE_PENDING) { 216 if (mode == DEVICE_MODE_PENDING) {
219 LOG(ERROR) << "Enrollment mode missing or unknown!"; 217 LOG(ERROR) << "Enrollment mode missing or unknown!";
220 SetState(STATE_BAD_ENROLLMENT_MODE); 218 SetState(STATE_BAD_ENROLLMENT_MODE);
221 return; 219 return;
222 } 220 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 case STATE_UNMANAGED: 349 case STATE_UNMANAGED:
352 case STATE_ERROR: 350 case STATE_ERROR:
353 case STATE_TEMPORARY_ERROR: 351 case STATE_TEMPORARY_ERROR:
354 case STATE_BAD_AUTH: 352 case STATE_BAD_AUTH:
355 FetchTokenInternal(); 353 FetchTokenInternal();
356 break; 354 break;
357 } 355 }
358 } 356 }
359 357
360 } // namespace policy 358 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/device_token_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698