[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / chromeos / network / shill_service_observer.h
blob1365f0ef4d3f7a6c7dff83615ed25b24658168ab
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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_
6 #define CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "chromeos/dbus/shill_property_changed_observer.h"
13 namespace chromeos {
14 namespace internal {
16 // Class to manage Shill service property changed observers. Observers are
17 // added on construction and removed on destruction. Runs the handler when
18 // OnPropertyChanged is called.
19 class ShillServiceObserver : public ShillPropertyChangedObserver {
20 public:
21 typedef base::Callback<void(const std::string& service,
22 const std::string& name,
23 const base::Value& value)> Handler;
25 ShillServiceObserver(const std::string& service_path,
26 const Handler& handler);
28 virtual ~ShillServiceObserver();
30 // ShillPropertyChangedObserver overrides.
31 virtual void OnPropertyChanged(const std::string& key,
32 const base::Value& value) OVERRIDE;
34 private:
35 std::string service_path_;
36 Handler handler_;
38 DISALLOW_COPY_AND_ASSIGN(ShillServiceObserver);
41 } // namespace internal
42 } // namespace chromeos
44 #endif // CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_