summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/prefs/pref_observer_bridge.h
blob: 4e105467165e18b74f985a2a32d35797ff34e54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_PREFS_PREF_OBSERVER_BRIDGE_H_
#define IOS_CHROME_BROWSER_PREFS_PREF_OBSERVER_BRIDGE_H_

#include <string>

#include "base/compiler_specific.h"

class PrefChangeRegistrar;

@protocol PrefObserverDelegate
- (void)onPreferenceChanged:(const std::string&)preferenceName;
@end

class PrefObserverBridge {
 public:
  explicit PrefObserverBridge(id<PrefObserverDelegate> delegate);
  virtual ~PrefObserverBridge();

  virtual void ObserveChangesForPreference(const std::string& pref_name,
                                           PrefChangeRegistrar* registrar);

 private:
  virtual void OnPreferenceChanged(const std::string& pref_name);

  id<PrefObserverDelegate> delegate_;
};

#endif  // IOS_CHROME_BROWSER_PREFS_PREF_OBSERVER_BRIDGE_H_