summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/network_list.h
diff options
context:
space:
mode:
authornkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 13:50:44 +0000
committernkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 13:50:44 +0000
commita697dcc6b45d4831d3fd53afe8f6463461b3ed0f (patch)
tree4d996fdc93dd7b791ddfcf72b3ac66f2761bb8d1 /chrome/browser/chromeos/network_list.h
parent79ea90be68675c0366173334b269f15f156e2dbf (diff)
downloadchromium_src-a697dcc6b45d4831d3fd53afe8f6463461b3ed0f.zip
chromium_src-a697dcc6b45d4831d3fd53afe8f6463461b3ed0f.tar.gz
chromium_src-a697dcc6b45d4831d3fd53afe8f6463461b3ed0f.tar.bz2
Update welcome screen based on mocks.
- Wizard is proceed to the next screen once "Continue" button is clicked and selected network is connected. - Preselect Ethernet if it's connected. - Clear selection when encrypted network dialog has been cancelled. - Ask for network selection when connection timed out. - Support list of connected/connecting networks. BUG=cros:3279, cros:3306 TEST=Welcome screen & network selection should work. Review URL: http://codereview.chromium.org/2077019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/network_list.h')
-rw-r--r--chrome/browser/chromeos/network_list.h42
1 files changed, 28 insertions, 14 deletions
diff --git a/chrome/browser/chromeos/network_list.h b/chrome/browser/chromeos/network_list.h
index 2995f80..f08b23a 100644
--- a/chrome/browser/chromeos/network_list.h
+++ b/chrome/browser/chromeos/network_list.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_CHROMEOS_NETWORK_LIST_H_
#define CHROME_BROWSER_CHROMEOS_NETWORK_LIST_H_
+#include <string>
#include <vector>
#include "chrome/browser/chromeos/cros/network_library.h"
@@ -28,6 +29,10 @@ class NetworkList {
: network_type(NETWORK_EMPTY),
connected(false) {}
NetworkItem(NetworkType network_type,
+ const string16& label)
+ : network_type(network_type),
+ label(label) {}
+ NetworkItem(NetworkType network_type,
string16 label,
WifiNetwork wifi_network,
CellularNetwork cellular_network)
@@ -52,11 +57,11 @@ class NetworkList {
return networks_.empty();
}
- // Returns currently connected network if there is one.
- const NetworkList::NetworkItem* ConnectedNetwork() const;
+ // Returns true, if specified network is currently connected.
+ bool IsNetworkConnected(NetworkType type, const string16& id) const;
- // Returns currently connecting network if there is one.
- const NetworkList::NetworkItem* ConnectingNetwork() const;
+ // Returns true, if specified network is currently connected.
+ bool IsNetworkConnecting(NetworkType type, const string16& id) const;
// Returns network by it's type and ssid (Wifi) or id (Cellular).
// If network is not available NULL is returned.
@@ -80,21 +85,30 @@ class NetworkList {
private:
typedef std::vector<NetworkItem> NetworkItemVector;
+ typedef std::vector<size_t> NetworkIndexVector;
+
+ // Returns true if the specified network is in the list.
+ bool IsInNetworkList(const NetworkIndexVector& list,
+ NetworkType type,
+ const string16& id) const;
+
+ // Returns true if network is of the same type and id.
+ bool IsSameNetwork(const NetworkList::NetworkItem* network,
+ NetworkType type,
+ const std::string& id) const;
- // Set connected/connecting network indices.
- // index - network index being processed
- void SetNetworksIndices(int index, bool connected, bool connecting);
+ // Adds network index to the corresponding connected/connecting network list.
+ // |index| - network index being processed
+ void AddNetworkIndexToList(size_t index, bool connected, bool connecting);
- // Cached list of all available networks.
+ // Cached list of all available networks with their connection states.
NetworkItemVector networks_;
- // Index of currently connected network or -1 if there's none.
- // If several networks are connected than single one is selected by priority:
- // Ethernet > WiFi > Cellular.
- int connected_network_index_;
+ // Connected networks indexes.
+ NetworkIndexVector connected_networks_;
- // Index of currently connecting network or -1 if there's none.
- int connecting_network_index_;
+ // Connecting networks indexes.
+ NetworkIndexVector connecting_networks_;
DISALLOW_COPY_AND_ASSIGN(NetworkList);
};