summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros/network_library.cc
diff options
context:
space:
mode:
authorchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 01:28:14 +0000
committerchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 01:28:14 +0000
commitca9f6706f4e732bcc399d03d9f777be7a81c577e (patch)
tree458aa2f60f330e7e83a9fa14ffe7b54abe4396c0 /chrome/browser/chromeos/cros/network_library.cc
parent59565102cf40aa74f8564f9368ce4cf27c335de2 (diff)
downloadchromium_src-ca9f6706f4e732bcc399d03d9f777be7a81c577e.zip
chromium_src-ca9f6706f4e732bcc399d03d9f777be7a81c577e.tar.gz
chromium_src-ca9f6706f4e732bcc399d03d9f777be7a81c577e.tar.bz2
Don't allow connection to networks that are not connected.
For example, if Google-A is not configure, it will be disabled in the network menu and not selectable in the options pages. And from oobe/login, Google-A will always be disabled b/c the certificates will not be there until the user logs in. BUG=chromium-os:8293 TEST=Manual. From oobe, make sure google-a is disabled. Before setting up google-a, make sure google-a is disabled in network menu and options pages. Then set up google-a and see that it's now enabled in both network menu and options page. Log out and check that google-a is disabled. Review URL: http://codereview.chromium.org/4976007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros/network_library.cc')
-rw-r--r--chrome/browser/chromeos/cros/network_library.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index b983daa1..c67a495 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -35,6 +35,7 @@ namespace {
// straight out of libcros:chromeos_network.cc. Fix this by moving
// all handling of properties into libcros.
// Network service properties we are interested in monitoring
+static const char* kConnectableProperty = "Connectable";
static const char* kIsActiveProperty = "IsActive";
static const char* kStateProperty = "State";
static const char* kSignalStrengthProperty = "Strength";
@@ -219,14 +220,18 @@ Network::Network(const Network& network) {
type_ = network.type();
state_ = network.state();
error_ = network.error();
+ connectable_ = network.connectable();
+ is_active_ = network.is_active();
}
void Network::Clear() {
- state_ = STATE_UNKNOWN;
- error_ = ERROR_UNKNOWN;
service_path_.clear();
device_path_.clear();
ip_address_.clear();
+ type_ = TYPE_UNKNOWN;
+ state_ = STATE_UNKNOWN;
+ error_ = ERROR_UNKNOWN;
+ connectable_ = true;
is_active_ = false;
}
@@ -236,6 +241,7 @@ Network::Network(const ServiceInfo* service) {
error_ = service->error;
service_path_ = SafeString(service->service_path);
device_path_ = SafeString(service->device_path);
+ connectable_ = service->connectable;
is_active_ = service->is_active;
ip_address_.clear();
// If connected, get ip config.
@@ -1424,7 +1430,8 @@ class NetworkLibraryImpl : public NetworkLibrary {
wifi3->set_name("Fake Wifi 3");
wifi3->set_strength(50);
wifi3->set_connected(false);
- wifi3->set_encryption(SECURITY_WEP);
+ wifi3->set_encryption(SECURITY_8021X);
+ wifi3->set_connectable(false);
wifi_networks_.push_back(wifi3);
wifi_ = wifi2;
@@ -1641,7 +1648,10 @@ class NetworkLibraryImpl : public NetworkLibrary {
}
network = wireless;
}
- if (strcmp(key, kIsActiveProperty) == 0) {
+ if (strcmp(key, kConnectableProperty) == 0) {
+ if (value->GetAsBoolean(&boolval))
+ network->set_connectable(boolval);
+ } else if (strcmp(key, kIsActiveProperty) == 0) {
if (value->GetAsBoolean(&boolval))
network->set_active(boolval);
} else if (strcmp(key, kStateProperty) == 0) {