diff options
8 files changed, 44 insertions, 8 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index eb94d66..1a239a2 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -10891,9 +10891,12 @@ ls' lab."> <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_DNSSERVER" desc="In settings Internet options, the label dns server."> DNS server: </message> - <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CHANGE_PROXY_BUTTON" desc="For ethernet and remembered services, change proxy button text in chrome:settings/internet."> + <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CHANGE_PROXY_BUTTON" desc="In settings Internet options, the button to configure proxy settings."> Change proxy settings... </message> + <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_ENABLE_SHARED_PROXIES_HINT" desc="In settings Internet options, when proxy can't be changed, the hint for user to do so by enabling the setting for IDS_OPTIONS_SETTINGS_USE_SHARED_PROXIES."> + To change proxy settings, enable "Use shared proxies" setting. + </message> <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_HARDWARE_ADDRESS" desc="In settings Internet options, the label hardware address."> Hardware address: </message> @@ -11934,6 +11937,9 @@ ls' lab."> <message name="IDS_VERSION_FIELD_PREFIX" desc="Display the OS version to the user."> version </message> + <message name="IDS_PROXY_PAGE_TITLE_FORMAT" desc="The title of the proxy page for a specific network."> + Network proxy for <ph name="NETWORK_NAME">$1<ex>Ethernet</ex></ph> + </message> <message name="IDS_PROXY_CONFIG_TITLE" desc="The title of the basic proxy config."> Proxy Configuration </message> diff --git a/chrome/browser/resources/options/chromeos/internet_detail.html b/chrome/browser/resources/options/chromeos/internet_detail.html index c68a6ea..80ad879 100644 --- a/chrome/browser/resources/options/chromeos/internet_detail.html +++ b/chrome/browser/resources/options/chromeos/internet_detail.html @@ -299,7 +299,11 @@ </section> <section id="change-proxy-section"> <div> - <button id="change-proxy" i18n-content="changeProxyButton"></button> + <button id="change-proxy-button" i18n-content="changeProxyButton"> + </button> + </div> + <div id="enable-shared-proxies-hint" + i18n-content="enableSharedProxiesHint" hidden> </div> </section> </div> diff --git a/chrome/browser/resources/options/chromeos/internet_network_element.js b/chrome/browser/resources/options/chromeos/internet_network_element.js index 007793f..d63844eb 100644 --- a/chrome/browser/resources/options/chromeos/internet_network_element.js +++ b/chrome/browser/resources/options/chromeos/internet_network_element.js @@ -241,6 +241,8 @@ cr.define('options.internet', function() { buttonsDiv.appendChild( this.createButton_('options_button', 'options', function(e) { + options.ProxyOptions.getInstance().setNetworkName( + self.data.networkName); chrome.send('buttonClickCallback', [String(self.data.networkType), self.data.servicePath, diff --git a/chrome/browser/resources/options/chromeos/internet_options.js b/chrome/browser/resources/options/chromeos/internet_options.js index 91108e3..bda3784 100644 --- a/chrome/browser/resources/options/chromeos/internet_options.js +++ b/chrome/browser/resources/options/chromeos/internet_options.js @@ -82,7 +82,7 @@ cr.define('options', function() { event.target.disabled = true; chrome.send('disableCellular', []); }); - $('change-proxy').addEventListener('click', function(event) { + $('change-proxy-button').addEventListener('click', function(event) { OptionsPage.closeOverlay(); OptionsPage.showPageByName('proxy', false); chrome.send('coreOptionsUserMetricsAction', @@ -444,8 +444,13 @@ cr.define('options', function() { $('ipTypeDHCPDiv').hidden = !data.showStaticIPConfig; $('ipTypeStaticDiv').hidden = !data.showStaticIPConfig; - // Hide change-proxy-section if proxy is not configurable. - $('change-proxy-section').hidden = !data.proxyConfigurable; + // Hide change-proxy-button if proxy is not configurable. + $('change-proxy-button').hidden = !data.proxyConfigurable; + // Hide enable-shared-proxies-hint if proxy configuration cannot be enabled. + $('enable-shared-proxies-hint').hidden = !data.showSharedProxiesHint; + // Hide change-proxy-section if both button and hint are hidden. + $('change-proxy-section').hidden = !data.proxyConfigurable && + !data.showSharedProxiesHint; var ipConfigList = $('ipConfigList'); ipConfigList.disabled = $('ipTypeDHCP').checked || !data.showStaticIPConfig; diff --git a/chrome/browser/resources/options/chromeos/proxy.html b/chrome/browser/resources/options/chromeos/proxy.html index 1ac0101..433f12a 100644 --- a/chrome/browser/resources/options/chromeos/proxy.html +++ b/chrome/browser/resources/options/chromeos/proxy.html @@ -1,5 +1,5 @@ <div id="proxyPage" class="page" hidden> - <h1 i18n-content="proxyPage"></h1> + <h1 id="proxy-page-title" i18n-content="proxyPage"></h1> <section> <h3 i18n-content="proxy_config_title"></h3> <div> diff --git a/chrome/browser/resources/options/chromeos/proxy_options.js b/chrome/browser/resources/options/chromeos/proxy_options.js index 537e2f9..6af0804 100644 --- a/chrome/browser/resources/options/chromeos/proxy_options.js +++ b/chrome/browser/resources/options/chromeos/proxy_options.js @@ -181,6 +181,16 @@ cr.define('options', function() { for (var x = 0; x < selectedItems.length; x++) { $('ignoredHostList').removeException(selectedItems[x]); } + }, + + /** + * Sets proxy page title using given network name. + * @param {string} network The network name to use in page title. + * @public + */ + setNetworkName: function(network) { + $('proxy-page-title').textContent = + localStrings.getStringF('proxyPageTitleFormat', network); } }; 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 9d1027c..afc7f6a 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc @@ -115,6 +115,9 @@ void InternetOptionsHandler::GetLocalizedValues( localized_strings->SetString("changeProxyButton", l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CHANGE_PROXY_BUTTON)); + localized_strings->SetString("enableSharedProxiesHint", + l10n_util::GetStringUTF16( + IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_ENABLE_SHARED_PROXIES_HINT)); localized_strings->SetString("wifiNetworkTabLabel", l10n_util::GetStringUTF16( @@ -687,10 +690,14 @@ void InternetOptionsHandler::PopulateDictionaryDetails( dictionary.SetBoolean("connected", network->connected()); dictionary.SetString("connectionState", network->GetStateString()); bool remembered = (network->profile_type() != chromeos::PROFILE_NONE); - dictionary.SetBoolean("proxyConfigurable", + bool proxy_configurable = (remembered && (network->profile_type() == chromeos::PROFILE_USER || use_shared_proxies)) || - (type == chromeos::TYPE_ETHERNET && use_shared_proxies)); + (type == chromeos::TYPE_ETHERNET && use_shared_proxies); + dictionary.SetBoolean("proxyConfigurable", proxy_configurable); + dictionary.SetBoolean("showSharedProxiesHint", + !proxy_configurable && !use_shared_proxies && + (remembered || type == chromeos::TYPE_ETHERNET)); // Hide the dhcp/static radio if not ethernet or wifi (or if not enabled) bool staticIPConfig = CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc b/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc index d375c56..ed91179 100644 --- a/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc @@ -33,6 +33,8 @@ void ProxyHandler::GetLocalizedValues( // Proxy page - ChromeOS localized_strings->SetString("proxyPage", l10n_util::GetStringUTF16(IDS_OPTIONS_PROXY_TAB_LABEL)); + localized_strings->SetString("proxyPageTitleFormat", + l10n_util::GetStringUTF16(IDS_PROXY_PAGE_TITLE_FORMAT)); localized_strings->SetString("proxy_config_title", l10n_util::GetStringUTF16(IDS_PROXY_CONFIG_TITLE)); localized_strings->SetString("proxyDirectInternetConnection", |