blob: d6e576e17b14f5dd59b89de0acd0eb3a14e1239d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/device-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://md-settings/settings_page/settings_animated_pages.html">
<link rel="import" href="bluetooth_device_list_item.html">
<link rel="import" href="bluetooth_add_device_dialog.html">
<link rel="import" href="bluetooth_pair_device_dialog.html">
<dom-module id="settings-bluetooth-page">
<link rel="import" type="css" href="chrome://md-settings/settings_shared.css">
<link rel="import" type="css" href="bluetooth_page.css">
<template>
<settings-animated-pages id="pages" current-route="{{currentRoute}}"
section="bluetooth">
<neon-animatable id="main">
<div class="settings-box">
<div class="layout horizontal center">
<iron-icon icon="device:bluetooth"></iron-icon>
<span class="flex" i18n-content="bluetoothEnable"></span>
<cr-expand-button id="expandListButton"
hidden$="[[!bluetoothEnabled]]"
expanded="{{deviceListExpanded}}">
</cr-expand-button>
<paper-toggle-button id="enableBluetooth"
checked="{{bluetoothEnabled}}"
on-change="onBluetoothEnabledChange_">
</paper-toggle-button>
</div>
<iron-collapse opened="[[deviceListExpanded]]">
<div id="deviceList" class="layout vertical"
on-device-event="onDeviceEvent_">
<span class="no-devices"
hidden$="[[haveDevices_(deviceList.splices)]]"
i18n-content="bluetoothNoDevices">
</span>
<template is="dom-repeat" items="[[deviceList]]"
filter="deviceIsPairedOrConnecting_">
<bluetooth-device-list-item device="[[item]]">
</bluetooth-device-list-item>
</template>
</div>
<div class="settings-box" hidden$="[[!bluetoothEnabled]]">
<paper-button id="addDevice" i18n-content="bluetoothAddDevice"
on-tap="onAddDeviceTap_">
</paper-button>
</div>
</iron-collapse>
</div>
</neon-animatable>
</settings-animated-pages>
<paper-dialog modal id="deviceDialog" class="layout vertical"
on-iron-overlay-opened="onDialogOpened_"
on-iron-overlay-closed="onDialogClosed_">
<template is="dom-if" if="[[dialogIsVisible_(dialog, 'addDevice')]]"
restamp>
<settings-bluetooth-add-device-dialog
class="layout vertical flex"
adapter-state="[[adapterState]]"
device-list="[[deviceList]]"
on-device-event="onDeviceEvent_"
on-close-dialog="onCloseDialog_">
</settings-bluetooth-add-device-dialog>
</template>
<template is="dom-if" if="[[dialogIsVisible_(dialog, 'pairDevice')]]"
restamp>
<settings-bluetooth-pair-device-dialog
class="layout vertical flex"
pairing-device="[[pairingDevice]]"
pairing-event="[[pairingEvent]]"
on-response="onResponse_"
on-close-dialog="onCloseDialog_">
</settings-bluetooth-pair-device-dialog>
</template>
</paper-dialog>
</template>
<script src="bluetooth_page.js"></script>
</dom-module>
|