| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 // No other value can be represented in an int64_t. | 51 // No other value can be represented in an int64_t. |
| 52 return AutoEnrollmentClient::kMaximumPower + 1; | 52 return AutoEnrollmentClient::kMaximumPower + 1; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Sets or clears a value in a dictionary. | 55 // Sets or clears a value in a dictionary. |
| 56 void UpdateDict(base::DictionaryValue* dict, | 56 void UpdateDict(base::DictionaryValue* dict, |
| 57 const char* pref_path, | 57 const char* pref_path, |
| 58 bool set_or_clear, | 58 bool set_or_clear, |
| 59 base::Value* value) { | 59 base::Value* value) { |
| 60 scoped_ptr<base::Value> scoped_value(value); | 60 std::unique_ptr<base::Value> scoped_value(value); |
| 61 if (set_or_clear) | 61 if (set_or_clear) |
| 62 dict->Set(pref_path, scoped_value.release()); | 62 dict->Set(pref_path, scoped_value.release()); |
| 63 else | 63 else |
| 64 dict->Remove(pref_path, NULL); | 64 dict->Remove(pref_path, NULL); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Converts a restore mode enum value from the DM protocol into the | 67 // Converts a restore mode enum value from the DM protocol into the |
| 68 // corresponding prefs string constant. | 68 // corresponding prefs string constant. |
| 69 std::string ConvertRestoreMode( | 69 std::string ConvertRestoreMode( |
| 70 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { | 70 em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 base::TimeDelta delta = kZero; | 433 base::TimeDelta delta = kZero; |
| 434 if (!time_extra_start_.is_null()) | 434 if (!time_extra_start_.is_null()) |
| 435 delta = now - time_extra_start_; | 435 delta = now - time_extra_start_; |
| 436 // This samples |kZero| when there was no need for extra time, so that we can | 436 // This samples |kZero| when there was no need for extra time, so that we can |
| 437 // measure the ratio of users that succeeded without needing a delay to the | 437 // measure the ratio of users that succeeded without needing a delay to the |
| 438 // total users going through OOBE. | 438 // total users going through OOBE. |
| 439 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); | 439 UMA_HISTOGRAM_CUSTOM_TIMES(kUMAExtraTime, delta, kMin, kMax, kBuckets); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace policy | 442 } // namespace policy |
| OLD | NEW |