diff options
-rw-r--r-- | chrome/browser/resources/options/chromeos/internet_detail.html | 21 | ||||
-rw-r--r-- | chrome/browser/resources/options/chromeos/internet_detail.js | 9 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chromeos/about_network.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc | 19 | ||||
-rw-r--r-- | chromeos/docs/onc_spec.html | 12 | ||||
-rw-r--r-- | chromeos/network/onc/onc_constants.cc | 1 | ||||
-rw-r--r-- | chromeos/network/onc/onc_constants.h | 1 | ||||
-rw-r--r-- | chromeos/network/onc/onc_signature.cc | 1 |
8 files changed, 59 insertions, 11 deletions
diff --git a/chrome/browser/resources/options/chromeos/internet_detail.html b/chrome/browser/resources/options/chromeos/internet_detail.html index b2c76dd..8c90aba 100644 --- a/chrome/browser/resources/options/chromeos/internet_detail.html +++ b/chrome/browser/resources/options/chromeos/internet_detail.html @@ -46,7 +46,7 @@ <span class="active-tab-label" i18n-content="cellularDeviceTabLabel"></span> </span> - <span id="internet-nav-tab" class="tab network-details" + <span id="internet-nav-tab" class="tab network-details" tab-contents="internet-tab"> <span class="tab-label" i18n-content="networkTabLabel"></span> <span class="active-tab-label" i18n-content="networkTabLabel"></span> @@ -214,6 +214,23 @@ <div id="vpn-tab" class="subpages-tab-contents vpn-details"> <section> <table class="option-control-table"> + <tr class="auto-connect-network"> + <td> + <div class="checkbox"> + <span class="controlled-setting-with-label"> + <input id="auto-connect-network-vpn" type="checkbox"> + <span> + <label for="auto-connect-network-vpn" + i18n-content="inetAutoConnectNetwork"> + </label> + <span class="controlled-setting-indicator" + data="autoConnect" for="auto-connect-network-vpn"> + </span> + </span> + </span> + </div> + </td> + </tr> <tr> <td class="option-name" i18n-content="inetServiceName"></td> <td id="inet-service-name" class="option-value"></td> @@ -462,7 +479,7 @@ </div> <table id="user-dns-settings"> <tr> - <td class="spacer" width="14px"></td> + <td class="spacer" width="14px"></td> <td> <div id="ipconfig-dns1" i18n-placeholder-text="userNameServer1" allow-empty> diff --git a/chrome/browser/resources/options/chromeos/internet_detail.js b/chrome/browser/resources/options/chromeos/internet_detail.js index 9c33346..2a61dd2 100644 --- a/chrome/browser/resources/options/chromeos/internet_detail.js +++ b/chrome/browser/resources/options/chromeos/internet_detail.js @@ -617,8 +617,8 @@ cr.define('options.internet', function() { $('auto-connect-network-wifi').checked ? 'true' : 'false']); } else if (data.type == Constants.TYPE_WIMAX) { chrome.send('setAutoConnect', - [servicePath, - $('auto-connect-network-wimax').checked ? 'true' : 'false']); + [servicePath, + $('auto-connect-network-wimax').checked ? 'true' : 'false']); } else if (data.type == Constants.TYPE_CELLULAR) { chrome.send('setAutoConnect', [servicePath, @@ -628,6 +628,9 @@ cr.define('options.internet', function() { chrome.send('setServerHostname', [servicePath, $('inet-server-hostname').value]); + chrome.send('setAutoConnect', + [servicePath, + $('auto-connect-network-vpn').checked ? 'true' : 'false']); } var nameServerTypes = ['automatic', 'google', 'user']; @@ -1066,6 +1069,8 @@ cr.define('options.internet', function() { OptionsPage.hideBubble(); inetServerHostname.value = data.serverHostname.recommendedValue; }; + $('auto-connect-network-vpn').checked = data.autoConnect.value; + $('auto-connect-network-vpn').disabled = false; } else { OptionsPage.showTab($('internet-nav-tab')); detailsPage.ethernet = true; diff --git a/chrome/browser/ui/webui/chromeos/about_network.cc b/chrome/browser/ui/webui/chromeos/about_network.cc index 3679f08..0117531f 100644 --- a/chrome/browser/ui/webui/chromeos/about_network.cc +++ b/chrome/browser/ui/webui/chromeos/about_network.cc @@ -78,9 +78,10 @@ std::string NetworkToHtmlTableHeader(const Network* network) { WrapWithTH("Name") + WrapWithTH("Active") + WrapWithTH("State"); + if (network->type() != TYPE_ETHERNET) + str += WrapWithTH("Auto-Connect"); if (network->type() == TYPE_WIFI || network->type() == TYPE_CELLULAR) { - str += WrapWithTH("Auto-Connect"); str += WrapWithTH("Strength"); } if (network->type() == TYPE_WIFI) { @@ -113,11 +114,12 @@ std::string NetworkToHtmlTableRow(const Network* network) { WrapWithTD(network->name()) + WrapWithTD(base::IntToString(network->is_active())) + WrapWithTD(network->GetStateString()); + if (network->type() != TYPE_ETHERNET) + str += WrapWithTD(base::IntToString(network->auto_connect())); if (network->type() == TYPE_WIFI || network->type() == TYPE_CELLULAR) { const WirelessNetwork* wireless = static_cast<const WirelessNetwork*>(network); - str += WrapWithTD(base::IntToString(wireless->auto_connect())); str += WrapWithTD(base::IntToString(wireless->strength())); } if (network->type() == TYPE_WIFI) { diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc index cb2947a..625a95d 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc @@ -1351,12 +1351,23 @@ void InternetOptionsHandler::PopulateIPConfigsCallback( property_ui_data); chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); + std::string onc_path_to_auto_connect; if (type == chromeos::TYPE_WIFI) { + onc_path_to_auto_connect = base::StringPrintf( + "%s.%s", + chromeos::onc::network_config::kWiFi, + chromeos::onc::wifi::kAutoConnect); + } else if (type == chromeos::TYPE_VPN) { + onc_path_to_auto_connect = base::StringPrintf( + "%s.%s", + chromeos::onc::network_config::kVPN, + chromeos::onc::vpn::kAutoConnect); + } + if (!onc_path_to_auto_connect.empty()) { auto_connect_ui_data.ParseOncProperty( - ui_data, onc, - base::StringPrintf("%s.%s", - chromeos::onc::network_config::kWiFi, - chromeos::onc::wifi::kAutoConnect)); + ui_data, + onc, + onc_path_to_auto_connect); } SetValueDictionary(&dictionary, kTagAutoConnect, new base::FundamentalValue(network->auto_connect()), diff --git a/chromeos/docs/onc_spec.html b/chromeos/docs/onc_spec.html index f715bae..5220b17 100644 --- a/chromeos/docs/onc_spec.html +++ b/chromeos/docs/onc_spec.html @@ -476,7 +476,8 @@ (optional, defaults to <span class="value">false</span>) <span class="type">boolean</span> </span> - Indicating network should be connected when in range. + Indicating that the network should be connected to automatically when in + range. </dd> <dt class="field">EAP</dt> @@ -552,6 +553,15 @@ </p> <dl class="field_list"> + <dt class="field">AutoConnect</dt> + <dd> + <span class="field_meta"> + (optional, defaults to <span class="value">false</span>) + <span class="type">boolean</span> + </span> + Indicating that the network should be connected to automatically. + </dd> + <dt class="field">Host</dt> <dd> <span class="field_meta"> diff --git a/chromeos/network/onc/onc_constants.cc b/chromeos/network/onc/onc_constants.cc index b8e8d87..9b199bf 100644 --- a/chromeos/network/onc/onc_constants.cc +++ b/chromeos/network/onc/onc_constants.cc @@ -188,6 +188,7 @@ const char kAuthNoCache[] = "AuthNoCache"; const char kAuthRetry[] = "AuthRetry"; const char kAuth[] = "Auth"; const char kAuthenticationType[] = "AuthenticationType"; +const char kAutoConnect[] = "AutoConnect"; const char kCert[] = "Cert"; const char kCipher[] = "Cipher"; const char kClientCertPattern[] = "ClientCertPattern"; diff --git a/chromeos/network/onc/onc_constants.h b/chromeos/network/onc/onc_constants.h index 29b686a..dae7131 100644 --- a/chromeos/network/onc/onc_constants.h +++ b/chromeos/network/onc/onc_constants.h @@ -201,6 +201,7 @@ CHROMEOS_EXPORT extern const char kAuthNoCache[]; CHROMEOS_EXPORT extern const char kAuthRetry[]; CHROMEOS_EXPORT extern const char kAuth[]; CHROMEOS_EXPORT extern const char kAuthenticationType[]; +CHROMEOS_EXPORT extern const char kAutoConnect[]; CHROMEOS_EXPORT extern const char kCert[]; CHROMEOS_EXPORT extern const char kCipher[]; CHROMEOS_EXPORT extern const char kClientCertPattern[]; diff --git a/chromeos/network/onc/onc_signature.cc b/chromeos/network/onc/onc_signature.cc index a8766aa..942fbda 100644 --- a/chromeos/network/onc/onc_signature.cc +++ b/chromeos/network/onc/onc_signature.cc @@ -148,6 +148,7 @@ const OncFieldSignature openvpn_fields[] = { const OncFieldSignature vpn_fields[] = { { kRecommended, NULL, &kRecommendedSignature }, + { vpn::kAutoConnect, flimflam::kAutoConnectProperty, &kBoolSignature }, { vpn::kHost, flimflam::kProviderHostProperty, &kStringSignature }, { vpn::kIPsec, NULL, &kIPsecSignature }, { vpn::kL2TP, NULL, &kL2TPSignature }, |