OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/prefs/pref_notifier.h" | 5 #include "chrome/browser/prefs/pref_notifier.h" |
6 | 6 |
7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 9 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const NotificationDetails& details) { | 120 const NotificationDetails& details) { |
121 using policy::ConfigurationPolicyPrefStore; | 121 using policy::ConfigurationPolicyPrefStore; |
122 | 122 |
123 if (type == NotificationType::POLICY_CHANGED) { | 123 if (type == NotificationType::POLICY_CHANGED) { |
124 PrefValueStore::AfterRefreshCallback* callback = | 124 PrefValueStore::AfterRefreshCallback* callback = |
125 NewCallback(this, | 125 NewCallback(this, |
126 &PrefNotifier::FireObserversForRefreshedManagedPrefs); | 126 &PrefNotifier::FireObserversForRefreshedManagedPrefs); |
127 // The notification of the policy refresh can come from any thread, | 127 // The notification of the policy refresh can come from any thread, |
128 // but the manipulation of the PrefValueStore must happen on the UI | 128 // but the manipulation of the PrefValueStore must happen on the UI |
129 // thread, thus the policy refresh must be explicitly started on it. | 129 // thread, thus the policy refresh must be explicitly started on it. |
130 ChromeThread::PostTask( | 130 BrowserThread::PostTask( |
131 ChromeThread::UI, FROM_HERE, | 131 BrowserThread::UI, FROM_HERE, |
132 NewRunnableMethod( | 132 NewRunnableMethod( |
133 pref_value_store_, | 133 pref_value_store_, |
134 &PrefValueStore::RefreshPolicyPrefs, | 134 &PrefValueStore::RefreshPolicyPrefs, |
135 ConfigurationPolicyPrefStore::CreateManagedPolicyPrefStore(), | 135 ConfigurationPolicyPrefStore::CreateManagedPolicyPrefStore(), |
136 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore(), | 136 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore(), |
137 callback)); | 137 callback)); |
138 } | 138 } |
139 } | 139 } |
OLD | NEW |