| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/user_policy_token_cache.h" | 5 #include "chrome/browser/policy/user_policy_token_cache.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "chrome/browser/policy/enterprise_metrics.h" | 10 #include "chrome/browser/policy/enterprise_metrics.h" |
| 11 #include "chrome/browser/policy/proto/device_management_local.pb.h" | 11 #include "chrome/browser/policy/proto/device_management_local.pb.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 | 13 |
| 14 using content::BrowserThread; |
| 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Other places can sample on the same UMA counter, so make sure they all do | 18 // Other places can sample on the same UMA counter, so make sure they all do |
| 17 // it on the same thread (UI). | 19 // it on the same thread (UI). |
| 18 void SampleUMAOnUIThread(policy::MetricToken sample) { | 20 void SampleUMAOnUIThread(policy::MetricToken sample) { |
| 19 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 20 UMA_HISTOGRAM_ENUMERATION(policy::kMetricToken, sample, | 22 UMA_HISTOGRAM_ENUMERATION(policy::kMetricToken, sample, |
| 21 policy::kMetricTokenSize); | 23 policy::kMetricTokenSize); |
| 22 } | 24 } |
| 23 | 25 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 165 |
| 164 token_ = new_token; | 166 token_ = new_token; |
| 165 loader_->Store(new_token, data_store_->device_id()); | 167 loader_->Store(new_token, data_store_->device_id()); |
| 166 } | 168 } |
| 167 } | 169 } |
| 168 | 170 |
| 169 void UserPolicyTokenCache::OnCredentialsChanged() { | 171 void UserPolicyTokenCache::OnCredentialsChanged() { |
| 170 } | 172 } |
| 171 | 173 |
| 172 } // namespace policy | 174 } // namespace policy |
| OLD | NEW |