Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: chrome/browser/policy/device_token_fetcher.cc

Issue 6409040: New policy protobuf protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698