Index: ash/system/chromeos/network/tray_network_state_observer.h |
diff --git a/ash/system/chromeos/network/tray_network_state_observer.h b/ash/system/chromeos/network/tray_network_state_observer.h |
index 94ea75f6dc1d7d40782bf73172acf2f8a7b50284..4a61dfd8079482e84e73624f531343ee8a554c45 100644 |
--- a/ash/system/chromeos/network/tray_network_state_observer.h |
+++ b/ash/system/chromeos/network/tray_network_state_observer.h |
@@ -13,17 +13,23 @@ |
namespace ash { |
namespace internal { |
-class TrayNetwork; |
- |
class TrayNetworkStateObserver : public chromeos::NetworkStateHandlerObserver { |
public: |
- enum WifiState { |
- WIFI_DISABLED, |
- WIFI_ENABLED, |
- WIFI_UNKNOWN, |
+ class Delegate { |
+ public: |
+ // Called when the network state may have changed. If |list_changed| is |
+ // true then the list of networks may have changed. |
+ virtual void NetworkStateChanged(bool list_changed) = 0; |
+ |
+ // Called when the properties for |network| may have been updated. |
+ virtual void NetworkServiceChanged( |
+ const chromeos::NetworkState* network) = 0; |
+ |
+ protected: |
+ virtual ~Delegate() {} |
}; |
- explicit TrayNetworkStateObserver(TrayNetwork* tray); |
+ explicit TrayNetworkStateObserver(Delegate* delegate); |
virtual ~TrayNetworkStateObserver(); |
@@ -36,9 +42,14 @@ class TrayNetworkStateObserver : public chromeos::NetworkStateHandlerObserver { |
virtual void NetworkPropertiesUpdated( |
const chromeos::NetworkState* network) OVERRIDE; |
+ // Keep track of user initiated connecting networks |
+ static void AddConnectingNetwork(const std::string& service_path); |
+ |
+ // Returns true if a user initiated connection to |network| occured |
+ static bool HasConnectingNetwork(const std::string& service_path); |
+ |
private: |
- TrayNetwork* tray_; |
- WifiState wifi_state_; // cache wifi enabled state |
+ Delegate* delegate_; |
DISALLOW_COPY_AND_ASSIGN(TrayNetworkStateObserver); |
}; |