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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_policy_service.cc

Issue 2159223002: Fixed cloud policy refresh API to return correct value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/policy_ui_handler.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/device_local_account_policy_service.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 &core_, 188 &core_,
189 invalidation_service_provider_)); 189 invalidation_service_provider_));
190 } 190 }
191 191
192 void DeviceLocalAccountPolicyBroker::UpdateRefreshDelay() { 192 void DeviceLocalAccountPolicyBroker::UpdateRefreshDelay() {
193 if (core_.refresh_scheduler()) { 193 if (core_.refresh_scheduler()) {
194 const base::Value* policy_value = 194 const base::Value* policy_value =
195 store_->policy_map().GetValue(key::kPolicyRefreshRate); 195 store_->policy_map().GetValue(key::kPolicyRefreshRate);
196 int delay = 0; 196 int delay = 0;
197 if (policy_value && policy_value->GetAsInteger(&delay)) 197 if (policy_value && policy_value->GetAsInteger(&delay))
198 core_.refresh_scheduler()->SetRefreshDelay(delay); 198 core_.refresh_scheduler()->SetDesiredRefreshDelay(delay);
199 } 199 }
200 } 200 }
201 201
202 std::string DeviceLocalAccountPolicyBroker::GetDisplayName() const { 202 std::string DeviceLocalAccountPolicyBroker::GetDisplayName() const {
203 std::string display_name; 203 std::string display_name;
204 const base::Value* display_name_value = 204 const base::Value* display_name_value =
205 store_->policy_map().GetValue(policy::key::kUserDisplayName); 205 store_->policy_map().GetValue(policy::key::kUserDisplayName);
206 if (display_name_value) 206 if (display_name_value)
207 display_name_value->GetAsString(&display_name); 207 display_name_value->GetAsString(&display_name);
208 return display_name; 208 return display_name;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 } 562 }
563 return nullptr; 563 return nullptr;
564 } 564 }
565 565
566 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( 566 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated(
567 const std::string& user_id) { 567 const std::string& user_id) {
568 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id)); 568 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id));
569 } 569 }
570 570
571 } // namespace policy 571 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/policy_ui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698