Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2792)

Unified Diff: ash/system/chromeos/network/tray_network_state_observer.h

Issue 12387065: Convert TrayVPN to use new NetworkState code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | ash/system/chromeos/network/tray_network_state_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698