summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/controller-pairing-screen.html
blob: a31686d188d01d6b6ff9b42360477f70fb62d758 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file. -->

<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-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-selector.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/fade-in-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/fade-out-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/hero-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animated-pages.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-shared-element-animatable-behavior.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-item/paper-icon-item.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-material.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-progress.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">

<!--
List of devices.
Published properties:
  * devices - array of strings, the model of the list.
  * selected - a name of the selected device ('null' if no devices are
    selected).
  * connecting - a binary attribute. If set, the list does not respond to the
    user actions and a spinner is shown near selected device.
-->
<dom-module name="pairing-device-list">
  <link rel="stylesheet" href="pairing_device_list.css">

  <iron-iconset-svg name="pairing-device-list-icons">
    <svg><defs><g id="circle">
      <circle cx="12" cy="12" r="12"></circle>
    </g></defs></svg>
  </iron-iconset-svg>

  <template>
    <iron-selector selected="{{selected}}" attr-for-selected="name">
      <template is="dom-repeat" items="[[devices]]">
        <paper-icon-item name$="[[item]]" class="relative">
          <iron-icon icon="pairing-device-list-icons:circle" item-icon
              style$="[[getStyleForDeviceIcon_(item)]]">
          </iron-icon>
          <div><span>[[item]]</span></div>
          <div class="flex horizontal end-justified layout center">
            <div class="throbber"></div>
          </div>
        </paper-icon-item>
      </template>
    </iron-selector>
  </template>
</dom-module>

<!--
Single page of the controller's out-of-box flow.
The page consists of the top part and the bottom part.
The top part contains a title of the page. Direct successors of the
<controller-pairing-page> having 'title' class will be inserted there.
The bottom part contains controls that are aligned right  (all the successors
that are <paper-button>s) and a content of the page (all the other successors).
Special case is a help button (<paper-button> with 'help' class set) which
is aligned left.
There are several classes that can be used to change the page appearance:
  * split - if this class is set, top and bottom parts will have different
    colors.
  * big-font - if this class is set, slightly bigger font is used on page.
  * progress - if this class is set and 'split' is not, progress bar is shown
    instead of top and bottom parts separator.

Also height of the top part can be specified in CSS as follows:

controller-pairing-page::shadow #top {
  height: 100px;
}
-->
<dom-module name="controller-pairing-page">
  <link rel="stylesheet" href="controller_pairing_page.css">

  <template>
    <div class="vertical layout fit">
      <div id="top" class="relative vertical end-justified layout">
        <div id="title">
          <content select=".title"></content>
        </div>
        <div id="separator">
          <paper-progress indeterminate></paper-progress>
        </div>
      </div>
      <div id="bottom" class="flex vertical layout">
        <div class="flex vertical layout">
          <content select=":not(paper-button)"></content>
        </div>
        <div id="controls" class="horizontal layout center">
          <div class="flex">
            <content select="paper-button.help-button"></content>
          </div>
          <content select="paper-button"></content>
        </div>
      </div>
    </div>
  </template>
</dom-module>

<dom-module name="controller-pairing-screen">
  <link rel="stylesheet" href="oobe_screen_controller_pairing.css">

  <template>
    <paper-material class="fit">
      <neon-animated-pages id="pages" selected="{{C.page}}"
          attr-for-selected="name" class="fit">
        <controller-pairing-page name="devices-discovery" class="big-font">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_welcomeTitle">
          </div>
          <div i18n-content="login_ControllerPairingScreen_searching"></div>
          <paper-button class="help-button" on-tap="helpButtonClicked_"
              i18n-content="login_ControllerPairingScreen_helpBtn">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="device-select" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_selectTitle">
          </div>
          <pairing-device-list devices="[[C.devices]]"
              selected="{{selectedDevice}}">
          </pairing-device-list>
          <paper-button class="help-button" on-tap="helpButtonClicked_"
              i18n-content="login_ControllerPairingScreen_helpBtn">
          </paper-button>
          <paper-button on-tap="userActed" action="chooseDevice"
              disabled$="[[C.controlsDisabled]]"
              i18n-content="login_ControllerPairingScreen_connectBtn">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="device-not-found">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_troubleConnectingTitle">
          </div>
          <div i18n-content="login_ControllerPairingScreen_connectingAdvice">
          </div>
          <paper-button on-tap="userActed" action="repeatDiscovery"
              i18n-content="login_ControllerPairingScreen_adviceGotItBtn">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="establishing-connection" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_selectTitle">
          </div>
          <pairing-device-list devices="[[C.devices]]"
              selected="{{selectedDevice}}" connecting>
          </pairing-device-list>
          <paper-button class="help-button" on-tap="helpButtonClicked_"
              i18n-content="login_ControllerPairingScreen_helpBtn">
          </paper-button>
          <paper-button disabled
              i18n-content="login_ControllerPairingScreen_connecting">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="establishing-connection-error">
          <!-- TODO(dzhioev): Strings TBD. http://crbug.com/423740 -->
          <div class="title">
            Unable to connect to <span>[[selectedDevice]]<span>
          </div>
          <paper-button on-tap="userActed" action="repeatDiscovery">
            Repeat discovery
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="code-confirmation" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_confirmationTitle">
          </div>
          <div
              i18n-content="login_ControllerPairingScreen_confirmationQuestion">
          </div>
          <div id="code"><span>[[C.code]]</span></div>
          <paper-button on-tap="userActed" action="rejectCode"
              disabled$="[[C.controlsDisabled]"
              i18n-content="login_ControllerPairingScreen_rejectCodeBtn">
          </paper-button>
          <paper-button on-tap="userActed" action="acceptCode"
              disabled$="[[C.controlsDisabled]]"
              i18n-content="login_ControllerPairingScreen_acceptCodeBtn">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="host-update" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_updateTitle">
          </div>
          <div i18n-content="login_ControllerPairingScreen_updateText"></div>
          <paper-progress indeterminate></paper-progress>
        </controller-pairing-page>

        <controller-pairing-page name="host-connection-lost" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_connectionLostTitle">
          </div>
          <div i18n-content="login_ControllerPairingScreen_connectionLostText">
          </div>
          <paper-progress indeterminate></paper-progress>
        </controller-pairing-page>

        <controller-pairing-page name="enrollment-introduction" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_enrollTitle">
          </div>
          <p i18n-content="login_ControllerPairingScreen_enrollText1"></p>
          <p>
            <strong i18n-content="login_ControllerPairingScreen_enrollText2">
            </strong>
          </p>
          <paper-button on-tap="userActed" action="proceedToAuthentication"
              disabled$="[[C.controlsDisabled]]"
              i18n-content="login_ControllerPairingScreen_continueBtn">
          </paper-button>
        </controller-pairing-page>

        <controller-pairing-page name="authentication" class="split">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_enrollTitle">
          </div>
          <div>Not implemented.</div>
        </controller-pairing-page>

        <controller-pairing-page name="host-enrollment" class="progress">
          <!-- This title contains <strong> tag inside. -->
          <html-echo class="title"
              content="[[getHostEnrollmentStepTitle_(C.enrollmentDomain)]]">
          </html-echo>
        </controller-pairing-page>

        <controller-pairing-page name="host-enrollment-error" class="progress">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_enrollmentErrorTitle">
          </div>
          <div
              i18n-content="login_ControllerPairingScreen_enrollmentErrorHostRestarts">
          </div>
        </controller-pairing-page>

        <controller-pairing-page name="pairing-done" class="big-font">
          <div class="title"
              i18n-content="login_ControllerPairingScreen_successTitle">
          </div>
          <div><span>[[getSuccessMessage_(selectedDevice)]]</div>
          <paper-button on-tap="userActed" action="startSession"
              disabled$="{{C.controlsDisabled}}"
              i18n-content="login_ControllerPairingScreen_continueToHangoutsBtn">
          </paper-button>
        </controller-pairing-page>
      </neon-animated-pages>
    </paper-material>
  </template>
</dom-module>