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

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

Issue 2714493002: Load DeviceLocalAccount policy and DeviceSettings immediately on restore after Chrome crash. (Closed)
Patch Set: add flag to correctly process LoadImmediately() call Created 3 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 DeviceLocalAccountPolicyBroker::~DeviceLocalAccountPolicyBroker() { 157 DeviceLocalAccountPolicyBroker::~DeviceLocalAccountPolicyBroker() {
158 store_->RemoveObserver(this); 158 store_->RemoveObserver(this);
159 external_data_manager_->SetPolicyStore(nullptr); 159 external_data_manager_->SetPolicyStore(nullptr);
160 external_data_manager_->Disconnect(); 160 external_data_manager_->Disconnect();
161 } 161 }
162 162
163 void DeviceLocalAccountPolicyBroker::Initialize() { 163 void DeviceLocalAccountPolicyBroker::Initialize() {
164 store_->Load(); 164 store_->Load();
165 } 165 }
166 166
167 void DeviceLocalAccountPolicyBroker::LoadImmediately() {
168 store_->LoadImmediately();
169 }
170
167 bool DeviceLocalAccountPolicyBroker::HasInvalidatorForTest() const { 171 bool DeviceLocalAccountPolicyBroker::HasInvalidatorForTest() const {
168 return invalidator_ != nullptr; 172 return invalidator_ != nullptr;
169 } 173 }
170 174
171 void DeviceLocalAccountPolicyBroker::ConnectIfPossible( 175 void DeviceLocalAccountPolicyBroker::ConnectIfPossible(
172 chromeos::DeviceSettingsService* device_settings_service, 176 chromeos::DeviceSettingsService* device_settings_service,
173 DeviceManagementService* device_management_service, 177 DeviceManagementService* device_management_service,
174 scoped_refptr<net::URLRequestContextGetter> request_context) { 178 scoped_refptr<net::URLRequestContextGetter> request_context) {
175 if (core_.client()) 179 if (core_.client())
176 return; 180 return;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 return nullptr; 574 return nullptr;
571 } 575 }
572 576
573 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( 577 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated(
574 const std::string& user_id) { 578 const std::string& user_id) {
575 for (auto& observer : observers_) 579 for (auto& observer : observers_)
576 observer.OnPolicyUpdated(user_id); 580 observer.OnPolicyUpdated(user_id);
577 } 581 }
578 582
579 } // namespace policy 583 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698