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_
10 #include "base/callback.h"
11 #include "chromeos/dbus/shill_property_changed_observer.h"
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
{
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
;
35 std::string service_path_
;
38 DISALLOW_COPY_AND_ASSIGN(ShillServiceObserver
);
41 } // namespace internal
42 } // namespace chromeos
44 #endif // CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_