diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 16:46:02 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 16:46:02 +0000 |
commit | ab9fb2953e2744a74a5ce3b8e1c830a3bd692543 (patch) | |
tree | ccaca3f851dc8632c13b99d41991a6952a55123e /chrome/browser/resources | |
parent | f46845a7751433e0e3a390b85f50a35c4230e22b (diff) | |
download | chromium_src-ab9fb2953e2744a74a5ce3b8e1c830a3bd692543.zip chromium_src-ab9fb2953e2744a74a5ce3b8e1c830a3bd692543.tar.gz chromium_src-ab9fb2953e2744a74a5ce3b8e1c830a3bd692543.tar.bz2 |
Adding wifi enable/disable buttons
BUG=chromium-os:6590
TEST=none
Review URL: http://codereview.chromium.org/3556012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
4 files changed, 62 insertions, 2 deletions
diff --git a/chrome/browser/resources/options/chromeos_internet_options.html b/chrome/browser/resources/options/chromeos_internet_options.html index a476c1e..2966b1a 100644 --- a/chrome/browser/resources/options/chromeos_internet_options.html +++ b/chrome/browser/resources/options/chromeos_internet_options.html @@ -1,5 +1,14 @@ <div class="page hidden" id="internetPage"> <h1 i18n-content="internetPage"></h1> + <section id="wirelessButtons"> + <h3 i18n-content="generalNetworkingTitle"></h3> + <div id="networkingControls"> + <button id="enableWifi" i18n-content="enableWifi"></button> + <button id="disableWifi" i18n-content="disableWifi"></button> + <button id="enableCellular" i18n-content="enableCellular"></button> + <button id="disableCellular" i18n-content="disableCellular"></button> + </div> + </section> <section id="wiredSection"> <h3 i18n-content="wired_title"></h3> <div class="networks" id="wiredList"></div> diff --git a/chrome/browser/resources/options/chromeos_internet_options.js b/chrome/browser/resources/options/chromeos_internet_options.js index 5982c53..4cb9096 100644 --- a/chrome/browser/resources/options/chromeos_internet_options.js +++ b/chrome/browser/resources/options/chromeos_internet_options.js @@ -42,7 +42,7 @@ cr.define('options', function() { $('wiredSection').hidden = (templateData.wiredList.length == 0); $('wirelessSection').hidden = (templateData.wirelessList.length == 0); $('rememberedSection').hidden = (templateData.rememberedList.length == 0); - + InternetOptions.setupAttributes(templateData); // Setting up the details page $('detailsInternetDismiss').onclick = function(event) { OptionsPage.clearOverlays(); @@ -51,6 +51,19 @@ cr.define('options', function() { $('detailsInternetLogin').onclick = function(event) { InternetOptions.loginFromDetails(); }; + $('enableWifi').onclick = function(event) { + chrome.send('enableWifi', []); + }; + $('disableWifi').onclick = function(event) { + chrome.send('disableWifi', []); + }; + $('enableCellular').onclick = function(event) { + chrome.send('disableCellular', []); + }; + $('disableCellular').onclick = function(event) { + chrome.send('disableCellular', []); + }; + } }; @@ -90,6 +103,25 @@ cr.define('options', function() { } }; + InternetOptions.setupAttributes = function(data) { + var buttons = $('wirelessButtons'); + if (data.wirelessList.length == 0) { + buttons.removeAttribute('hasWifi'); + } else { + buttons.setAttribute('hasWifi', 'true'); + } + if (!data.cellularAvailable) { + buttons.removeAttribute('cellularAvail'); + } else { + buttons.setAttribute('cellularAvail', 'true'); + if (data.cellularEnabled) { + buttons.setAttribute('hasCellular', 'true'); + } else { + buttons.removeAttribute('hasCellular'); + } + } + }; + // //Chrome callbacks // @@ -100,6 +132,7 @@ cr.define('options', function() { $('wiredSection').hidden = (data.wiredList.length == 0); $('wirelessSection').hidden = (data.wirelessList.length == 0); + InternetOptions.setupAttributes(data); $('rememberedSection').hidden = (data.rememberedList.length == 0); }; diff --git a/chrome/browser/resources/options/chromeos_internet_options_page.css b/chrome/browser/resources/options/chromeos_internet_options_page.css index 96c090c..f137c85 100644 --- a/chrome/browser/resources/options/chromeos_internet_options_page.css +++ b/chrome/browser/resources/options/chromeos_internet_options_page.css @@ -15,6 +15,10 @@ display: none; } +#networkingControls { + text-align: center; +} + .networks { -webkit-margin-start: 15px; padding: 2px; @@ -118,3 +122,16 @@ #detailsInternetPage[certPkcs] > #certNetwork { display: none; } + +#wirelessButtons > * > button { + display: block; +} + +#wirelessButtons[haswifi] > * > #enableWifi, +#wirelessButtons:not([haswifi]) > * > #disableWifi, +#wirelessButtons:not([cellularAvail]) > * > #disableCellular, +#wirelessButtons:not([cellularAvail]) > * > #enableCellular, +#wirelessButtons[hasCellular] > * > #enableCellular, +#wirelessButtons:not([hasCellular]) > * > #disableCellular { + display: none; +} diff --git a/chrome/browser/resources/options/options_page.css b/chrome/browser/resources/options/options_page.css index 9e3aae6..2fb67be 100644 --- a/chrome/browser/resources/options/options_page.css +++ b/chrome/browser/resources/options/options_page.css @@ -225,13 +225,14 @@ section { } section > h3 { - width: 100px; + width: 150px; font-weight: normal; -webkit-padding-start: 0; vertical-align: middle; margin: 0; font-size: 100%; padding-top: 2px; + font-weight: bold; } section > div:only-of-type { |