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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/policy/enterprise_metrics.h" | 9 #include "chrome/browser/policy/enterprise_metrics.h" |
10 #include "chrome/browser/policy/proto/device_management_local.pb.h" | 10 #include "chrome/browser/policy/proto/device_management_local.pb.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 cache_file_(cache_file) {} | 41 cache_file_(cache_file) {} |
42 | 42 |
43 void UserPolicyTokenLoader::Load() { | 43 void UserPolicyTokenLoader::Load() { |
44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
45 BrowserThread::PostTask( | 45 BrowserThread::PostTask( |
46 BrowserThread::FILE, FROM_HERE, | 46 BrowserThread::FILE, FROM_HERE, |
47 NewRunnableMethod(this, &UserPolicyTokenLoader::LoadOnFileThread)); | 47 NewRunnableMethod(this, &UserPolicyTokenLoader::LoadOnFileThread)); |
48 } | 48 } |
49 | 49 |
50 void UserPolicyTokenLoader::Store(const std::string& token, | 50 void UserPolicyTokenLoader::Store(const std::string& token, |
51 const std::string& device_id) { | 51 const std::string& device_id) { |
52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
53 BrowserThread::PostTask( | 53 BrowserThread::PostTask( |
54 BrowserThread::FILE, FROM_HERE, | 54 BrowserThread::FILE, FROM_HERE, |
55 NewRunnableMethod(this, | 55 NewRunnableMethod(this, |
56 &UserPolicyTokenLoader::StoreOnFileThread, | 56 &UserPolicyTokenLoader::StoreOnFileThread, |
57 token, | 57 token, |
58 device_id)); | 58 device_id)); |
59 } | 59 } |
60 | 60 |
61 UserPolicyTokenLoader::~UserPolicyTokenLoader() { | 61 UserPolicyTokenLoader::~UserPolicyTokenLoader() { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 token_ = new_token; | 162 token_ = new_token; |
163 loader_->Store(new_token, data_store_->device_id()); | 163 loader_->Store(new_token, data_store_->device_id()); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 void UserPolicyTokenCache::OnCredentialsChanged() { | 167 void UserPolicyTokenCache::OnCredentialsChanged() { |
168 } | 168 } |
169 | 169 |
170 } // namespace policy | 170 } // namespace policy |
OLD | NEW |