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

Side by Side Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html

Issue 2801403002: MD Settings: Bluetooth: Fix adapter state and discovery (Closed)
Patch Set: Use CHECK instead of early exit Created 3 years, 8 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 <link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.h tml"> 1 <link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.h tml">
2 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> 2 <link rel="import" href="chrome://resources/html/i18n_behavior.html">
3 <link rel="import" href="chrome://resources/html/polymer.html"> 3 <link rel="import" href="chrome://resources/html/polymer.html">
4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.htm l"> 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.htm l">
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spi nner.html"> 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spi nner.html">
7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/pap er-toggle-button.html"> 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/pap er-toggle-button.html">
8 <link rel="import" href="../i18n_setup.html"> 8 <link rel="import" href="../i18n_setup.html">
9 <link rel="import" href="../icons.html"> 9 <link rel="import" href="../icons.html">
10 <link rel="import" href="../settings_shared_css.html"> 10 <link rel="import" href="../settings_shared_css.html">
(...skipping 16 matching lines...) Expand all
27 paper-spinner { 27 paper-spinner {
28 @apply(--cr-icon-height-width); 28 @apply(--cr-icon-height-width);
29 } 29 }
30 30
31 #onoff[on] { 31 #onoff[on] {
32 color: var(--settings-toggle-color); 32 color: var(--settings-toggle-color);
33 } 33 }
34 </style> 34 </style>
35 35
36 <div class="settings-box first"> 36 <div class="settings-box first">
37 <div id="onoff" class="start" on$="[[bluetoothEnabled]]"> 37 <div id="onoff" class="start" on$="[[bluetoothToggleState]]">
38 [[getOnOffString_(bluetoothEnabled, 38 [[getOnOffString_(bluetoothToggleState,
39 '$i18nPolymer{deviceOn}', '$i18nPolymer{deviceOff}')]] 39 '$i18nPolymer{deviceOn}', '$i18nPolymer{deviceOff}')]]
40 </div> 40 </div>
41 <paper-toggle-button id="enableBluetooth" checked="{{bluetoothEnabled}}" 41 <paper-toggle-button id="enableBluetooth"
42 checked="{{bluetoothToggleState}}"
43 disabled$="[[bluetoothToggleDisabled]]"
42 aria-label="$i18n{bluetoothToggleA11yLabel}"> 44 aria-label="$i18n{bluetoothToggleA11yLabel}">
43 </paper-toggle-button> 45 </paper-toggle-button>
44 </div> 46 </div>
45 47
46 <!-- Paired device list --> 48 <!-- Paired device list -->
47 <div class="settings-box first header" hidden$="[[!bluetoothEnabled]]"> 49 <div class="settings-box first header" hidden="[[!bluetoothToggleState]]">
48 <div class="start">$i18n{bluetoothDeviceListPaired}</div> 50 <div class="start">$i18n{bluetoothDeviceListPaired}</div>
49 </div> 51 </div>
50 <div id="noPairedDevices" class="list-frame" 52 <div id="noPairedDevices" class="list-frame"
51 hidden$="[[!showNoDevices_(bluetoothEnabled, pairedDeviceList_)]]"> 53 hidden="[[!showNoDevices_(bluetoothToggleState, pairedDeviceList_)]]">
52 $i18n{bluetoothNoDevices} 54 $i18n{bluetoothNoDevices}
53 </div> 55 </div>
54 <div id="pairedContainer" class="container layout vertical" 56 <div id="pairedContainer" class="container layout vertical"
55 scrollable on-device-event="onDeviceEvent_" 57 scrollable on-device-event="onDeviceEvent_"
56 hidden="[[!showDevices_(bluetoothEnabled, pairedDeviceList_)]]"> 58 hidden="[[!showDevices_(bluetoothToggleState, pairedDeviceList_)]]">
57 <iron-list id="pairedDevices" class="vertical-list" 59 <iron-list id="pairedDevices" class="vertical-list"
58 items="[[pairedDeviceList_]]" 60 items="[[pairedDeviceList_]]"
59 selection-enabled selected-item="{{selectedPairedItem_}}" 61 selection-enabled selected-item="{{selectedPairedItem_}}"
60 scroll-target="pairedContainer"> 62 scroll-target="pairedContainer">
61 <template> 63 <template>
62 <bluetooth-device-list-item device="[[item]]" 64 <bluetooth-device-list-item device="[[item]]"
63 tabindex$="[[tabIndex]]"> 65 tabindex$="[[tabIndex]]">
64 </bluetooth-device-list-item> 66 </bluetooth-device-list-item>
65 </template> 67 </template>
66 </iron-list> 68 </iron-list>
67 </div> 69 </div>
68 70
69 <!-- Unpaired device list --> 71 <!-- Unpaired device list -->
70 <div class="settings-box first header" hidden$="[[!bluetoothEnabled]]"> 72 <div class="settings-box first header" hidden="[[!bluetoothToggleState]]">
71 <div class="start">$i18n{bluetoothDeviceListUnpaired}</div> 73 <div class="start">$i18n{bluetoothDeviceListUnpaired}</div>
72 <paper-spinner active="[[showSpinner_]]"> 74 <paper-spinner active="[[showSpinner_]]">
73 </paper-spinner> 75 </paper-spinner>
74 </div> 76 </div>
75 <div id="noUnpairedDevices" class="list-frame" 77 <div id="noUnpairedDevices" class="list-frame"
76 hidden$="[[!showNoDevices_(bluetoothEnabled, unpairedDeviceList_)]]"> 78 hidden="[[!showNoDevices_(bluetoothToggleState, unpairedDeviceList_)]]">
77 $i18n{bluetoothNoDevicesFound} 79 $i18n{bluetoothNoDevicesFound}
78 </div> 80 </div>
79 <div id="unpairedContainer" class="container layout vertical" 81 <div id="unpairedContainer" class="container layout vertical"
80 scrollable on-device-event="onDeviceEvent_" 82 scrollable on-device-event="onDeviceEvent_"
81 hidden="[[!showDevices_(bluetoothEnabled, unpairedDeviceList_)]]"> 83 hidden="[[!showDevices_(bluetoothToggleState, unpairedDeviceList_)]]">
82 <iron-list id="unpairedDevices" class="vertical-list" 84 <iron-list id="unpairedDevices" class="vertical-list"
83 items="[[unpairedDeviceList_]]" 85 items="[[unpairedDeviceList_]]"
84 selection-enabled selected-item="{{selectedUnpairedItem_}}" 86 selection-enabled selected-item="{{selectedUnpairedItem_}}"
85 scroll-target="unpairedContainer"> 87 scroll-target="unpairedContainer">
86 <template> 88 <template>
87 <bluetooth-device-list-item device="[[item]]" 89 <bluetooth-device-list-item device="[[item]]"
88 tabindex$="[[tabIndex]]"> 90 tabindex$="[[tabIndex]]">
89 </bluetooth-device-list-item> 91 </bluetooth-device-list-item>
90 </template> 92 </template>
91 </iron-list> 93 </iron-list>
92 </div> 94 </div>
93 95
94 <bluetooth-device-dialog id="deviceDialog" 96 <bluetooth-device-dialog id="deviceDialog"
95 bluetooth-private="[[bluetoothPrivate]]" 97 bluetooth-private="[[bluetoothPrivate]]"
96 dialog-id="[[dialogId_]]" 98 dialog-id="[[dialogId_]]"
97 error-message="[[errorMessage_]]" 99 error-message="[[errorMessage_]]"
98 on-close="onDialogClosed_" 100 on-close="onDialogClosed_"
99 on-device-event="onDeviceEvent_" 101 on-device-event="onDeviceEvent_"
100 pairing-device="[[pairingDevice_]]"> 102 pairing-device="[[pairingDevice_]]">
101 </bluetooth-device-dialog> 103 </bluetooth-device-dialog>
102 104
103 </template> 105 </template>
104 <script src="bluetooth_subpage.js"></script> 106 <script src="bluetooth_subpage.js"></script>
105 </dom-module> 107 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698