Index: chromeos/network/network_service_observer.h |
diff --git a/chromeos/network/network_service_observer.h b/chromeos/network/network_service_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1a4dc03da13697f62571e80ac078b7929fd4d175 |
--- /dev/null |
+++ b/chromeos/network/network_service_observer.h |
@@ -0,0 +1,42 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_NETWORK_NETWORK_SERVICE_OBSERVER_H_ |
+#define CHROMEOS_NETWORK_NETWORK_SERVICE_OBSERVER_H_ |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "chromeos/dbus/shill_property_changed_observer.h" |
+ |
+// Class to manage Shill service property changed observers. Observers are |
+// added on construction and removed on destruction. Runs the handler when |
+// 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
|
+ |
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
|
+namespace chromeos { |
+ |
+class NetworkServiceObserver : public ShillPropertyChangedObserver { |
+ public: |
+ typedef base::Callback<void(const std::string& service, |
+ const std::string& name, |
+ const base::Value& value)> Handler; |
+ |
+ 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.
|
+ |
+ virtual ~NetworkServiceObserver(); |
+ |
+ // ShillPropertyChangedObserver overrides. |
+ virtual void OnPropertyChanged(const std::string& key, |
+ const base::Value& value); |
+ |
+ private: |
+ std::string service_path_; |
+ Handler handler_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(NetworkServiceObserver); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_NETWORK_NETWORK_SERVICE_OBSERVER_H_ |