Chromium Code Reviews| 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_NETWORK_SERVICE_OBSERVER_H_ | |
| 6 #define CHROMEOS_NETWORK_NETWORK_SERVICE_OBSERVER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "chromeos/dbus/shill_property_changed_observer.h" | |
|
pneubeck (no reviews)
2012/10/25 14:42:17
Btw. shill_property_changed_observer.h only forwar
stevenjb
2012/10/25 22:05:22
Forward declaration is sufficient here though, yes
| |
| 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 NetworkServiceObserver : public ShillPropertyChangedObserver { | |
|
pneubeck (no reviews)
2012/10/25 14:42:17
You could call this ShillServiceObserver to make t
stevenjb
2012/10/25 22:05:22
Yeah, that's better, done.
| |
| 19 public: | |
| 20 typedef base::Callback<void(const std::string& service, | |
| 21 const std::string& name, | |
| 22 const base::Value& value)> Handler; | |
| 23 | |
| 24 NetworkServiceObserver(const std::string& service_path, | |
| 25 const Handler& handler); | |
| 26 | |
| 27 virtual ~NetworkServiceObserver(); | |
| 28 | |
| 29 // ShillPropertyChangedObserver overrides. | |
| 30 virtual void OnPropertyChanged(const std::string& key, | |
| 31 const base::Value& value); | |
| 32 | |
| 33 private: | |
| 34 std::string service_path_; | |
| 35 Handler handler_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(NetworkServiceObserver); | |
| 38 }; | |
| 39 | |
| 40 } // namespace chromeos | |
| 41 | |
| 42 #endif // CHROMEOS_NETWORK_NETWORK_SERVICE_OBSERVER_H_ | |
| OLD | NEW |