Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8653)

Unified Diff: chrome/browser/resources/options/chromeos/system_options.js

Issue 8539022: Bluetooth UI update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/chromeos/system_options.js
diff --git a/chrome/browser/resources/options/chromeos/system_options.js b/chrome/browser/resources/options/chromeos/system_options.js
index 7d5ae7a7ae80208fec6c6680821cad3745324b72..0a9faeb5c4a55476f49ffd5c93b5c5f7754d764f 100644
--- a/chrome/browser/resources/options/chromeos/system_options.js
+++ b/chrome/browser/resources/options/chromeos/system_options.js
@@ -51,11 +51,12 @@ cr.define('options', function() {
$('bluetooth-find-devices').onclick = function(event) {
findBluetoothDevices_();
};
- $('enable-bluetooth-check').onchange = function(event) {
- chrome.send('bluetoothEnableChange',
- [Boolean($('enable-bluetooth-check').checked)]);
+ $('enable-bluetooth').onclick = function(event) {
+ chrome.send('bluetoothEnableChange', [Boolean(true)]);
+ };
+ $('disable-bluetooth').onclick = function(event) {
+ chrome.send('bluetoothEnableChange', [Boolean(false)]);
};
-
$('language-button').onclick = function(event) {
OptionsPage.navigateToPage('language');
};
@@ -143,9 +144,15 @@ cr.define('options', function() {
* also be affected by a change to the state.
* @param {boolean} checked Flag Indicating if Bluetooth is turned on.
*/
- SystemOptions.setBluetoothCheckboxState = function(checked) {
- $('enable-bluetooth-check').checked = checked;
- $('bluetooth-find-devices').disabled = !checked;
+ SystemOptions.setBluetoothState = function(checked) {
+ $('disable-bluetooth').hidden = !checked;
+ $('enable-bluetooth').hidden = checked;
+ $('bluetooth-finder-container').hidden = !checked;
+ $('no-bluetooth-devices-label').hidden = !checked;
+ if (!checked) {
+ setVisibility_('bluetooth-scanning-label', false);
+ setVisibility_('bluetooth-scanning-icon', false);
+ }
// Flush list of previously discovered devices if bluetooth is turned off.
if (!checked) {
var devices = $('bluetooth-device-list').childNodes;
@@ -167,7 +174,8 @@ cr.define('options', function() {
* Decription of the bluetooth device.
*/
SystemOptions.addBluetoothDevice = function(device) {
- $('bluetooth-device-list').appendDevice(device);
+ if ($('bluetooth-device-list').appendDevice(device))
+ $('no-bluetooth-devices-label').hidden = true;
};
/**

Powered by Google App Engine
This is Rietveld 408576698