OLD | NEW |
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/chromeos/policy/auto_enrollment_client.h" | 5 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // corresponding prefs string constant. | 67 // corresponding prefs string constant. |
68 std::string ConvertRestoreMode( | 68 std::string ConvertRestoreMode( |
69 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { | 69 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { |
70 switch (restore_mode) { | 70 switch (restore_mode) { |
71 case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: | 71 case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: |
72 return std::string(); | 72 return std::string(); |
73 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED: | 73 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED: |
74 return kDeviceStateRestoreModeReEnrollmentRequested; | 74 return kDeviceStateRestoreModeReEnrollmentRequested; |
75 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: | 75 case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: |
76 return kDeviceStateRestoreModeReEnrollmentEnforced; | 76 return kDeviceStateRestoreModeReEnrollmentEnforced; |
| 77 case em::DeviceStateRetrievalResponse::RESTORE_MODE_DISABLED: |
| 78 return kDeviceStateRestoreModeDisabled; |
77 } | 79 } |
78 | 80 |
79 // Return is required to avoid compiler warning. | 81 // Return is required to avoid compiler warning. |
80 NOTREACHED() << "Bad restore mode " << restore_mode; | 82 NOTREACHED() << "Bad restore mode " << restore_mode; |
81 return std::string(); | 83 return std::string(); |
82 } | 84 } |
83 | 85 |
84 } // namespace | 86 } // namespace |
85 | 87 |
86 AutoEnrollmentClient::AutoEnrollmentClient( | 88 AutoEnrollmentClient::AutoEnrollmentClient( |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 new base::StringValue(state_response.management_domain())); | 407 new base::StringValue(state_response.management_domain())); |
406 | 408 |
407 std::string restore_mode = | 409 std::string restore_mode = |
408 ConvertRestoreMode(state_response.restore_mode()); | 410 ConvertRestoreMode(state_response.restore_mode()); |
409 UpdateDict(dict.Get(), | 411 UpdateDict(dict.Get(), |
410 kDeviceStateRestoreMode, | 412 kDeviceStateRestoreMode, |
411 !restore_mode.empty(), | 413 !restore_mode.empty(), |
412 new base::StringValue(restore_mode)); | 414 new base::StringValue(restore_mode)); |
413 | 415 |
414 UpdateDict(dict.Get(), | 416 UpdateDict(dict.Get(), |
415 kDeviceStateDisabled, | |
416 true /* set_or_clear */, | |
417 new base::FundamentalValue( | |
418 state_response.has_disabled_state())); | |
419 UpdateDict(dict.Get(), | |
420 kDeviceStateDisabledMessage, | 417 kDeviceStateDisabledMessage, |
421 state_response.has_disabled_state(), | 418 state_response.has_disabled_state(), |
422 new base::StringValue( | 419 new base::StringValue( |
423 state_response.disabled_state().message())); | 420 state_response.disabled_state().message())); |
424 } | 421 } |
425 local_state_->CommitPendingWrite(); | 422 local_state_->CommitPendingWrite(); |
426 device_state_available_ = true; | 423 device_state_available_ = true; |
427 progress = true; | 424 progress = true; |
428 } | 425 } |
429 | 426 |
(...skipping 25 matching lines...) Expand all Loading... |
455 base::TimeDelta delta = kZero; | 452 base::TimeDelta delta = kZero; |
456 if (!time_extra_start_.is_null()) | 453 if (!time_extra_start_.is_null()) |
457 delta = now - time_extra_start_; | 454 delta = now - time_extra_start_; |
458 // This samples |kZero| when there was no need for extra time, so that we can | 455 // This samples |kZero| when there was no need for extra time, so that we can |
459 // measure the ratio of users that succeeded without needing a delay to the | 456 // measure the ratio of users that succeeded without needing a delay to the |
460 // total users going through OOBE. | 457 // total users going through OOBE. |
461 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); | 458 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); |
462 } | 459 } |
463 | 460 |
464 } // namespace policy | 461 } // namespace policy |
OLD | NEW |