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

Side by Side Diff: chrome/browser/chromeos/device_settings_provider.cc

Issue 8815015: Fix a signed settings serialization issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed the nit. I will commit it if trybots are happy. Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/session_manager_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chromeos/device_settings_provider.h" 5 #include "chrome/browser/chromeos/device_settings_provider.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 void DeviceSettingsProvider::FinishSetInPolicy( 293 void DeviceSettingsProvider::FinishSetInPolicy(
294 const std::string& prop, 294 const std::string& prop,
295 const base::Value* value, 295 const base::Value* value,
296 SignedSettings::ReturnCode code, 296 SignedSettings::ReturnCode code,
297 const em::PolicyFetchResponse& policy) { 297 const em::PolicyFetchResponse& policy) {
298 if (code != SignedSettings::SUCCESS) { 298 if (code != SignedSettings::SUCCESS) {
299 LOG(ERROR) << "Can't serialize to policy error code: " << code; 299 LOG(ERROR) << "Can't serialize to policy error code: " << code;
300 Reload(); 300 Reload();
301 return; 301 return;
302 } 302 }
303 // Update the internal caches and set the trusted flag to true so that we
304 // can pass the trustedness check in the second call to SetInPolicy.
305 OnRetrievePolicyCompleted(code, policy);
306
303 SetInPolicy(prop, *value); 307 SetInPolicy(prop, *value);
304 } 308 }
305 309
306 void DeviceSettingsProvider::UpdateValuesCache() { 310 void DeviceSettingsProvider::UpdateValuesCache() {
307 const em::PolicyData data = policy(); 311 const em::PolicyData data = policy();
308 values_cache_.Clear(); 312 values_cache_.Clear();
309 313
310 if (data.has_username() && !data.has_request_token()) 314 if (data.has_username() && !data.has_request_token())
311 values_cache_.SetString(kDeviceOwner, data.username()); 315 values_cache_.SetString(kDeviceOwner, data.username());
312 316
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 Reload(); 518 Reload();
515 return; 519 return;
516 } 520 }
517 LOG(ERROR) << "No retries left"; 521 LOG(ERROR) << "No retries left";
518 break; 522 break;
519 } 523 }
520 } 524 }
521 } 525 }
522 526
523 } // namespace chromeos 527 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/session_manager_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698