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

Side by Side Diff: components/syncable_prefs/synced_pref_change_registrar.cc

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/synced_pref_change_registrar.h" 5 #include "components/syncable_prefs/synced_pref_change_registrar.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 8
9 namespace { 9 namespace {
10 10
11 void InvokeUnnamedCallback( 11 void InvokeUnnamedCallback(
12 const SyncedPrefChangeRegistrar::ChangeCallback& callback, 12 const SyncedPrefChangeRegistrar::ChangeCallback& callback,
13 const std::string& path, 13 const std::string& path,
14 bool from_sync) { 14 bool from_sync) {
15 callback.Run(from_sync); 15 callback.Run(from_sync);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path, 58 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path,
59 bool from_sync) { 59 bool from_sync) {
60 if (pref_service_->IsManagedPreference(path.c_str())) 60 if (pref_service_->IsManagedPreference(path.c_str()))
61 return; 61 return;
62 ObserverMap::const_iterator iter = observers_.find(path); 62 ObserverMap::const_iterator iter = observers_.find(path);
63 if (iter == observers_.end()) 63 if (iter == observers_.end())
64 return; 64 return;
65 iter->second.Run(path, from_sync); 65 iter->second.Run(path, from_sync);
66 } 66 }
OLDNEW
« no previous file with comments | « components/syncable_prefs/synced_pref_change_registrar.h ('k') | components/syncable_prefs/synced_pref_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698