summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
blob: cb249bebe13f6a57e0c832da8037a5bf34ae05ef (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.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-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
<link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="bluetooth_subpage.html">

<dom-module id="settings-bluetooth-page">
  <template>
    <style include="settings-shared">
    </style>
    <settings-animated-pages id="pages" section="bluetooth"
        focus-config="[[focusConfig_]]">
      <neon-animatable route-path="default">
        <template is="dom-if" if="[[!isSecondaryUser_]]">
          <div id="bluetoothDevices"
              class="settings-box two-line" actionable on-click="onTap_">
            <iron-icon icon="[[getIcon_(bluetoothToggleState_)]]"></iron-icon>
            <div class="middle">
              $i18n{bluetoothPageTitle}
              <div class="secondary" id="bluetoothSecondary">
                [[getOnOffString_(bluetoothToggleState_,
                '$i18nPolymer{deviceOn}', '$i18nPolymer{deviceOff}')]]
              </div>
            </div>
            <cr-policy-pref-indicator
                icon-aria-label="$i18n{bluetoothPageTitle}"
                pref="[[prefs.cros.device.allow_bluetooth]]"
                hidden="[[prefs.cros.device.allow_bluetooth.value]]">
            </cr-policy-pref-indicator>
            <template is="dom-if" if="[[bluetoothToggleState_]]">
              <paper-icon-button-light class="subpage-arrow">
                <button on-click="onSubpageArrowTap_"
                    aria-label="$i18n{bluetoothPageTitle}"
                    aria-describedby="bluetoothSecondary">
                </button>
              </paper-icon-button-light>
            </template>
            <div class="separator"></div>
            <cr-toggle id="enableBluetooth"
                checked="{{bluetoothToggleState_}}"
                disabled$="[[!isToggleEnabled_(
                    adapterState_, stateChangeInProgress_)]]"
                aria-label="$i18n{bluetoothToggleA11yLabel}">
            </cr-toggle>
          </div>
        </template>
        <template is="dom-if" if="[[isSecondaryUser_]]">
          <div id="bluetoothDevices" class="settings-box two-line">
            <iron-icon class="policy" icon="cr:group"></iron-icon>
            <div class="middle">
              [[i18n('bluetoothPrimaryUserControlled', primaryUserEmail_)]]
            </div>
          </div>
        </template>
      </neon-animatable>

      <template is="dom-if" route-path="/bluetoothDevices">
        <settings-subpage associated-control="[[$$('#bluetoothDevices')]]"
            page-title="$i18n{bluetoothPageTitle}">
          <settings-bluetooth-subpage
              adapter-state="[[adapterState_]]"
              bluetooth-toggle-state="{{bluetoothToggleState_}}"
              state-change-in-progress="[[stateChangeInProgress_]]"
              bluetooth="[[bluetooth]]"
              bluetooth-private="[[bluetoothPrivate]]">
          </settings-bluetooth-subpage>
        </settings-subpage>
      </template>

    </settings-animated-pages>
  </template>
  <script src="bluetooth_page.js"></script>
</dom-module>