| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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. | 
|  | 4 | 
|  | 5 #ifndef CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_ | 
|  | 6 #define CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_ | 
|  | 7 | 
|  | 8 #include <string> | 
|  | 9 | 
|  | 10 #include "base/callback.h" | 
|  | 11 #include "chromeos/dbus/shill_property_changed_observer.h" | 
|  | 12 | 
|  | 13 namespace chromeos { | 
|  | 14 | 
|  | 15 // Class to manage Shill service property changed observers. Observers are | 
|  | 16 // added on construction and removed on destruction. Runs the handler when | 
|  | 17 // OnPropertyChanged is called. | 
|  | 18 class ShillServiceObserver : public ShillPropertyChangedObserver { | 
|  | 19  public: | 
|  | 20   typedef base::Callback<void(const std::string& service, | 
|  | 21                               const std::string& name, | 
|  | 22                               const base::Value& value)> Handler; | 
|  | 23 | 
|  | 24   ShillServiceObserver(const std::string& service_path, | 
|  | 25                        const Handler& handler); | 
|  | 26 | 
|  | 27   virtual ~ShillServiceObserver(); | 
|  | 28 | 
|  | 29   // ShillPropertyChangedObserver overrides. | 
|  | 30   virtual void OnPropertyChanged(const std::string& key, | 
|  | 31                                  const base::Value& value) OVERRIDE; | 
|  | 32 | 
|  | 33  private: | 
|  | 34   std::string service_path_; | 
|  | 35   Handler handler_; | 
|  | 36 | 
|  | 37   DISALLOW_COPY_AND_ASSIGN(ShillServiceObserver); | 
|  | 38 }; | 
|  | 39 | 
|  | 40 }  // namespace chromeos | 
|  | 41 | 
|  | 42 #endif  // CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_ | 
| OLD | NEW | 
|---|