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

Side by Side Diff: chrome/browser/extensions/settings/settings_frontend.cc

Issue 10807086: Trigger chrome.storage.onChanged events for policy updates on the 'managed' namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/extensions/settings/settings_frontend.h" 5 #include "chrome/browser/extensions/settings/settings_frontend.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 caches_[settings_namespace::SYNC] = 110 caches_[settings_namespace::SYNC] =
111 new SyncOrLocalValueStoreCache( 111 new SyncOrLocalValueStoreCache(
112 settings_namespace::SYNC, 112 settings_namespace::SYNC,
113 factory, 113 factory,
114 sync_quota_limit_, 114 sync_quota_limit_,
115 observers_, 115 observers_,
116 profile_path); 116 profile_path);
117 117
118 #if defined(ENABLE_CONFIGURATION_POLICY) 118 #if defined(ENABLE_CONFIGURATION_POLICY)
119 caches_[settings_namespace::MANAGED] = 119 caches_[settings_namespace::MANAGED] =
120 new ManagedValueStoreCache(profile->GetPolicyService()); 120 new ManagedValueStoreCache(profile->GetPolicyService(), observers_);
121 #endif 121 #endif
122 } 122 }
123 123
124 SettingsFrontend::~SettingsFrontend() { 124 SettingsFrontend::~SettingsFrontend() {
125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
126 observers_->RemoveObserver(profile_observer_.get()); 126 observers_->RemoveObserver(profile_observer_.get());
127 // Destroy each cache in its preferred thread. The delete task will execute 127 // Destroy each cache in its preferred thread. The delete task will execute
128 // after any other task that might've been posted before. 128 // after any other task that might've been posted before.
129 for (CacheMap::iterator it = caches_.begin(); it != caches_.end(); ++it) { 129 for (CacheMap::iterator it = caches_.begin(); it != caches_.end(); ++it) {
130 ValueStoreCache* cache = it->second; 130 ValueStoreCache* cache = it->second;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 settings_namespace::Namespace settings_namespace) { 200 settings_namespace::Namespace settings_namespace) {
201 CacheMap::iterator it = caches_.find(settings_namespace); 201 CacheMap::iterator it = caches_.find(settings_namespace);
202 if (it != caches_.end()) { 202 if (it != caches_.end()) {
203 ValueStoreCache* cache = it->second; 203 ValueStoreCache* cache = it->second;
204 cache->GetMessageLoop()->DeleteSoon(FROM_HERE, cache); 204 cache->GetMessageLoop()->DeleteSoon(FROM_HERE, cache);
205 caches_.erase(it); 205 caches_.erase(it);
206 } 206 }
207 } 207 }
208 208
209 } // namespace extensions 209 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698