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

Side by Side Diff: ios/chrome/browser/prefs/pref_observer_bridge.mm

Issue 1662523004: Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/chrome/browser/prefs/pref_observer_bridge.h" 5 #import "ios/chrome/browser/prefs/pref_observer_bridge.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_change_registrar.h" 8 #include "components/prefs/pref_change_registrar.h"
9 9
10 PrefObserverBridge::PrefObserverBridge(id<PrefObserverDelegate> delegate) 10 PrefObserverBridge::PrefObserverBridge(id<PrefObserverDelegate> delegate)
11 : delegate_(delegate) { 11 : delegate_(delegate) {
12 } 12 }
13 13
14 PrefObserverBridge::~PrefObserverBridge() { 14 PrefObserverBridge::~PrefObserverBridge() {
15 } 15 }
16 16
17 void PrefObserverBridge::ObserveChangesForPreference( 17 void PrefObserverBridge::ObserveChangesForPreference(
18 const std::string& pref_name, 18 const std::string& pref_name,
19 PrefChangeRegistrar* registrar) { 19 PrefChangeRegistrar* registrar) {
20 PrefChangeRegistrar::NamedChangeCallback callback = base::Bind( 20 PrefChangeRegistrar::NamedChangeCallback callback = base::Bind(
21 &PrefObserverBridge::OnPreferenceChanged, base::Unretained(this)); 21 &PrefObserverBridge::OnPreferenceChanged, base::Unretained(this));
22 registrar->Add(pref_name.c_str(), callback); 22 registrar->Add(pref_name.c_str(), callback);
23 } 23 }
24 24
25 void PrefObserverBridge::OnPreferenceChanged(const std::string& pref_name) { 25 void PrefObserverBridge::OnPreferenceChanged(const std::string& pref_name) {
26 [delegate_ onPreferenceChanged:pref_name]; 26 [delegate_ onPreferenceChanged:pref_name];
27 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698