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" | |
| 12 | |
| 13 // Class to manage Shill service property changed observers. Observers are | |
| 14 // added on construction and removed on destruction. Runs the handler when | |
| 15 // OnPropertyChanged is called. | |
|
Greg Spencer (Chromium)
2012/10/23 23:19:10
Move this down to just before the class definition
pneubeck (no reviews)
2012/10/24 14:41:42
But when is that called? Only if the network is co
stevenjb
2012/10/25 00:41:58
Done.
stevenjb
2012/10/25 00:41:58
This should get called when any property for an ob
| |
| 16 | |
|
pneubeck (no reviews)
2012/10/24 14:41:42
forward declare base::Value
stevenjb
2012/10/25 00:41:58
In the ShillPropertyChangedObserver signature so u
| |
| 17 namespace chromeos { | |
| 18 | |
| 19 class NetworkServiceObserver : public ShillPropertyChangedObserver { | |
| 20 public: | |
| 21 typedef base::Callback<void(const std::string& service, | |
| 22 const std::string& name, | |
| 23 const base::Value& value)> Handler; | |
| 24 | |
| 25 NetworkServiceObserver(const std::string& service_path, Handler handler); | |
|
pneubeck (no reviews)
2012/10/24 14:41:42
according to comments in callback.h,
callbacks sho
stevenjb
2012/10/25 00:41:58
Done.
| |
| 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 |