Index: chromeos/network/network_state_handler_observer.h |
diff --git a/chromeos/network/network_state_handler_observer.h b/chromeos/network/network_state_handler_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c2ee34e89bfe1bcc737063fdea8943e52bfef38 |
--- /dev/null |
+++ b/chromeos/network/network_state_handler_observer.h |
@@ -0,0 +1,48 @@ |
+// 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_STATE_HANDLER_OBSERVER_H_ |
+#define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_OBSERVER_H_ |
+ |
+#include <string> |
+#include <vector> |
+#include "base/basictypes.h" |
+ |
+namespace chromeos { |
+ |
+class NetworkState; |
+ |
+// Observer class for all network state changes, including changes to |
+// active (connecting or connected) services. |
+class NetworkStateHandlerObserver { |
+ public: |
+ typedef std::vector<NetworkState*> NetworkStateList; |
+ |
+ NetworkStateHandlerObserver(); |
+ virtual ~NetworkStateHandlerObserver(); |
+ |
+ // If |property| is non empty than that property has changed. Otherwise |
pneubeck (no reviews)
2012/10/25 14:42:17
Nit: than -> then
The "otherwise" doesn't sound so
stevenjb
2012/10/25 22:05:22
This wasn't meant to be sophisticated. That would
|
+ // multiple properties may have changed. |
+ virtual void NetworkManagerChanged(const std::string& property); |
pneubeck (no reviews)
2012/10/25 14:42:17
I'm rather unhappy about this mixture of property
stevenjb
2012/10/25 22:05:22
I agree that this is not ideal, and I've been cons
|
+ // The list of networks changed. |
+ virtual void NetworkListChanged(const NetworkStateList& networks); |
+ // The active network changed. |network| will be NULL if there is no longer |
+ // an active network. |
+ virtual void ActiveNetworkChanged(const NetworkState* network); |
+ // The state of the active network changed. |
+ virtual void ActiveNetworkStateChanged(const NetworkState* network); |
+ // A network service property changed. |property| is the name of the changed |
+ // property (from service_constants.h). Note: for the active network, |
+ // this will be called in *addition* to ActiveNetworkStateChanged() if |
+ // property == flimflam::kStateProperty. |
+ virtual void NetworkServicePropertyChanged(const NetworkState* network, |
+ const std::string& property); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(NetworkStateHandlerObserver); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_OBSERVER_H_ |