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/chromeos/login/signed_settings_cache.h" | 5 #include "chrome/browser/chromeos/login/signed_settings_cache.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/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/cros_settings.h" |
10 #include "chrome/browser/chromeos/login/ownership_service.h" | 11 #include "chrome/browser/chromeos/login/ownership_service.h" |
11 #include "chrome/browser/chromeos/login/signed_settings_helper.h" | 12 #include "chrome/browser/chromeos/login/signed_settings_helper.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
15 | 16 |
16 using content::BrowserThread; | 17 using content::BrowserThread; |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 void OnStorePolicyCompleted(SignedSettings::ReturnCode code) { | 23 void OnStorePolicyCompleted(SignedSettings::ReturnCode code) { |
23 if (code != SignedSettings::SUCCESS) | 24 if (code != SignedSettings::SUCCESS) |
24 LOG(ERROR) << "Couldn't save temp store to the policy blob. code: " << code; | 25 LOG(ERROR) << "Couldn't save temp store to the policy blob. code: " << code; |
| 26 else |
| 27 CrosSettings::Get()->ReloadProviders(); |
25 } | 28 } |
26 | 29 |
27 void FinishFinalize(PrefService* local_state, | 30 void FinishFinalize(PrefService* local_state, |
28 SignedSettings::ReturnCode code, | 31 SignedSettings::ReturnCode code, |
29 const em::PolicyFetchResponse& policy) { | 32 const em::PolicyFetchResponse& policy) { |
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
31 | 34 |
32 if (code != SignedSettings::SUCCESS) { | 35 if (code != SignedSettings::SUCCESS) { |
33 LOG(ERROR) << "Can't finalize temp store error code:" << code; | 36 LOG(ERROR) << "Can't finalize temp store error code:" << code; |
34 return; | 37 return; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void Finalize(PrefService* local_state) { | 108 void Finalize(PrefService* local_state) { |
106 // Reload the initial policy blob, apply settings from temp storage, | 109 // Reload the initial policy blob, apply settings from temp storage, |
107 // and write back the blob. | 110 // and write back the blob. |
108 SignedSettingsHelper::Get()->StartRetrievePolicyOp( | 111 SignedSettingsHelper::Get()->StartRetrievePolicyOp( |
109 base::Bind(FinishFinalize, local_state)); | 112 base::Bind(FinishFinalize, local_state)); |
110 } | 113 } |
111 | 114 |
112 } // namespace signed_settings_cache | 115 } // namespace signed_settings_cache |
113 | 116 |
114 } // namespace chromeos | 117 } // namespace chromeos |
OLD | NEW |