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

Side by Side Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 10174003: Pass the previous and the current PolicyMap to Observers of the PolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 8 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 | Annotate | Revision Log
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/policy/configuration_policy_pref_store.h" 5 #include "chrome/browser/policy/configuration_policy_pref_store.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value)) 76 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value))
77 return PrefStore::READ_NO_VALUE; 77 return PrefStore::READ_NO_VALUE;
78 78
79 if (value) 79 if (value)
80 *value = stored_value; 80 *value = stored_value;
81 return PrefStore::READ_OK; 81 return PrefStore::READ_OK;
82 } 82 }
83 83
84 void ConfigurationPolicyPrefStore::OnPolicyUpdated( 84 void ConfigurationPolicyPrefStore::OnPolicyUpdated(
85 PolicyDomain domain, 85 PolicyDomain domain,
86 const std::string& component_id) { 86 const std::string& component_id,
87 const PolicyMap& previous,
88 const PolicyMap& current) {
87 DCHECK_EQ(POLICY_DOMAIN_CHROME, domain); 89 DCHECK_EQ(POLICY_DOMAIN_CHROME, domain);
88 DCHECK_EQ("", component_id); 90 DCHECK_EQ("", component_id);
89 Refresh(); 91 Refresh();
90 } 92 }
91 93
92 void ConfigurationPolicyPrefStore::OnPolicyServiceInitialized() { 94 void ConfigurationPolicyPrefStore::OnPolicyServiceInitialized() {
93 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, 95 FOR_EACH_OBSERVER(PrefStore::Observer, observers_,
94 OnInitializationCompleted(true)); 96 OnInitializationCompleted(true));
95 } 97 }
96 98
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // issue during startup. 147 // issue during startup.
146 BrowserThread::PostTask(BrowserThread::UI, 148 BrowserThread::PostTask(BrowserThread::UI,
147 FROM_HERE, 149 FROM_HERE,
148 base::Bind(&LogErrors, 150 base::Bind(&LogErrors,
149 base::Owned(errors.release()))); 151 base::Owned(errors.release())));
150 152
151 return prefs.release(); 153 return prefs.release();
152 } 154 }
153 155
154 } // namespace policy 156 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.h ('k') | chrome/browser/policy/policy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698