| 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/chromeos/policy/user_policy_token_loader.h" | 5 #include "chrome/browser/chromeos/policy/user_policy_token_loader.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/cloud/enterprise_metrics.h" | 10 #include "chrome/browser/policy/cloud/enterprise_metrics.h" | 
| 11 #include "chrome/browser/policy/cloud/proto/device_management_local.pb.h" | 11 #include "chrome/browser/policy/proto/cloud/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; | 14 using content::BrowserThread; | 
| 15 | 15 | 
| 16 namespace { | 16 namespace { | 
| 17 | 17 | 
| 18 // 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 | 
| 19 // it on the same thread (UI). | 19 // it on the same thread (UI). | 
| 20 void SampleUMAOnUIThread(policy::MetricToken sample) { | 20 void SampleUMAOnUIThread(policy::MetricToken sample) { | 
| 21   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 21   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80 } | 80 } | 
| 81 | 81 | 
| 82 void UserPolicyTokenLoader::NotifyOnUIThread(const std::string& token, | 82 void UserPolicyTokenLoader::NotifyOnUIThread(const std::string& token, | 
| 83                                              const std::string& device_id) { | 83                                              const std::string& device_id) { | 
| 84   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 84   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 
| 85   if (delegate_.get()) | 85   if (delegate_.get()) | 
| 86     delegate_->OnTokenLoaded(token, device_id); | 86     delegate_->OnTokenLoaded(token, device_id); | 
| 87 } | 87 } | 
| 88 | 88 | 
| 89 }  // namespace policy | 89 }  // namespace policy | 
| OLD | NEW | 
|---|