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

Side by Side Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js

Issue 2009023003: MD Settings: make bluetooth dialog resize like other settings-dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revive #dialogDeviceList for tests Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.exportPath('settings'); 5 cr.exportPath('settings');
6 6
7 (function() { 7 (function() {
8 8
9 var PairingEventType = chrome.bluetoothPrivate.PairingEventType; 9 var PairingEventType = chrome.bluetoothPrivate.PairingEventType;
10 10
(...skipping 15 matching lines...) Expand all
26 /** 26 /**
27 * The ordered list of bluetooth devices. 27 * The ordered list of bluetooth devices.
28 * @type {!Array<!chrome.bluetooth.Device>} 28 * @type {!Array<!chrome.bluetooth.Device>}
29 */ 29 */
30 deviceList: { 30 deviceList: {
31 type: Array, 31 type: Array,
32 value: /** @return {Array} */ function() { return []; }, 32 value: /** @return {Array} */ function() { return []; },
33 }, 33 },
34 }, 34 },
35 35
36 observers: ['deviceListChanged_(deviceList.*)'],
37
36 /** @private */ 38 /** @private */
37 adapterStateChanged_: function() { 39 adapterStateChanged_: function() {
38 if (!this.adapterState.powered) 40 if (!this.adapterState.powered)
39 this.fire('close-dialog'); 41 this.fire('close-dialog');
40 }, 42 },
41 43
42 /** 44 /**
43 * @param {!chrome.bluetooth.Device} device 45 * @param {!chrome.bluetooth.Device} device
44 * @return {boolean} 46 * @return {boolean}
45 * @private 47 * @private
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 I18nBehavior, 320 I18nBehavior,
319 settings.BluetoothAddDeviceBehavior, 321 settings.BluetoothAddDeviceBehavior,
320 settings.BluetoothPairDeviceBehavior, 322 settings.BluetoothPairDeviceBehavior,
321 ], 323 ],
322 324
323 properties: { 325 properties: {
324 /** Which version of this dialog to show (adding or pairing). */ 326 /** Which version of this dialog to show (adding or pairing). */
325 dialogType: String, 327 dialogType: String,
326 }, 328 },
327 329
330 /** @private */
331 deviceListChanged_: function(e) {
332 this.$.dialog.notifyResize();
333 },
334
328 /** 335 /**
329 * @param {string} dialogType 336 * @param {string} dialogType
330 * @return {string} The title of for that |dialogType|. 337 * @return {string} The title of for that |dialogType|.
331 */ 338 */
332 getTitle_: function(dialogType) { 339 getTitle_: function(dialogType) {
333 return this.i18n(dialogType == 'addDevice' ? 340 return this.i18n(dialogType == 'addDevice' ?
334 'bluetoothAddDevicePageTitle' : 'bluetoothPairDevicePageTitle'); 341 'bluetoothAddDevicePageTitle' : 'bluetoothPairDevicePageTitle');
335 }, 342 },
336 343
337 /** 344 /**
(...skipping 28 matching lines...) Expand all
366 open: function() { 373 open: function() {
367 this.$.dialog.open(); 374 this.$.dialog.open();
368 }, 375 },
369 376
370 close: function() { 377 close: function() {
371 this.$.dialog.close(); 378 this.$.dialog.close();
372 }, 379 },
373 }); 380 });
374 381
375 })(); 382 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698