Chromium Code Reviews| 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/device_token_fetcher.h" | 5 #include "chrome/browser/policy/device_token_fetcher.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 device_token_, | 167 device_token_, |
| 168 device_id_)); | 168 device_id_)); |
| 169 SetState(kStateHasDeviceToken); | 169 SetState(kStateHasDeviceToken); |
| 170 } else { | 170 } else { |
| 171 NOTREACHED(); | 171 NOTREACHED(); |
| 172 SetState(kStateFailure); | 172 SetState(kStateFailure); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void DeviceTokenFetcher::OnError(DeviceManagementBackend::ErrorCode code) { | 176 void DeviceTokenFetcher::OnError(DeviceManagementBackend::ErrorCode code) { |
| 177 LOG(WARNING) << "Token fetcher error:" << code; | |
|
gfeher
2011/02/09 17:50:43
Is this intentional?
Jakob Kummerow
2011/02/10 12:10:15
No. Done.
| |
| 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 178 // For privacy reasons, delete all identifying data when this device is not | 179 // For privacy reasons, delete all identifying data when this device is not |
| 179 // managed. | 180 // managed. |
| 180 if (code == DeviceManagementBackend::kErrorServiceManagementNotSupported) { | 181 if (code == DeviceManagementBackend::kErrorServiceManagementNotSupported) { |
| 181 device_token_ = std::string(); | 182 device_token_ = std::string(); |
| 182 device_id_ = std::string(); | 183 device_id_ = std::string(); |
| 183 BrowserThread::PostTask( | 184 BrowserThread::PostTask( |
| 184 BrowserThread::FILE, | 185 BrowserThread::FILE, |
| 185 FROM_HERE, | 186 FROM_HERE, |
| 186 // The Windows compiler needs explicit template instantiation. | 187 // The Windows compiler needs explicit template instantiation. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 DCHECK(no_error); | 332 DCHECK(no_error); |
| 332 file_util::WriteFile(path, data.c_str(), data.length()); | 333 file_util::WriteFile(path, data.c_str(), data.length()); |
| 333 } | 334 } |
| 334 | 335 |
| 335 // static | 336 // static |
| 336 std::string DeviceTokenFetcher::GenerateNewDeviceID() { | 337 std::string DeviceTokenFetcher::GenerateNewDeviceID() { |
| 337 return guid::GenerateGUID(); | 338 return guid::GenerateGUID(); |
| 338 } | 339 } |
| 339 | 340 |
| 340 } // namespace policy | 341 } // namespace policy |
| OLD | NEW |