OLD | NEW |
---|---|
1 <link rel="import" href="chrome://resources/polymer/core-animated-pages/core-ani mated-pages.html"> | 1 <!-- Copyright 2015 The Chromium Authors. All rights reserved. |
2 <link rel="import" href="chrome://resources/polymer/core-iconset-svg/core-iconse t-svg.html"> | 2 Use of this source code is governed by a BSD-style license that can be |
3 <link rel="import" href="chrome://resources/polymer/core-item/core-item.html"> | 3 found in the LICENSE file. --> |
4 <link rel="import" href="chrome://resources/polymer/core-selector/core-selector. html"> | 4 |
5 <link rel="import" href="chrome://resources/polymer/paper-button/paper-button.ht ml"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> |
6 <link rel="import" href="chrome://resources/polymer/paper-progress/paper-progres s.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> |
7 <link rel="import" href="chrome://resources/polymer/paper-shadow/paper-shadow.ht ml"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-i conset-svg.html"> |
8 <link rel="import" href="chrome://resources/polymer/polymer/polymer.html"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-sele ctor.html"> |
9 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animatio ns/fade-in-animation.html"> | |
10 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animatio ns/fade-out-animation.html"> | |
11 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animatio ns/hero-animation.html"> | |
12 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani mated-pages.html"> | |
13 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-sha red-element-animatable-behavior.html"> | |
14 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> | |
15 <link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-icon-i tem.html"> | |
16 <link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-ma terial.html"> | |
17 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-pr ogress.html"> | |
18 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html "> | |
19 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html"> | |
9 | 20 |
10 <!-- | 21 <!-- |
11 List of devices. | 22 List of devices. |
12 Published properties: | 23 Published properties: |
13 * devices - array of strings, the model of the list. | 24 * devices - array of strings, the model of the list. |
14 * selected - a name of the selected device ('null' if no devices are | 25 * selected - a name of the selected device ('null' if no devices are |
15 selected). | 26 selected). |
16 * connecting - a binary attribute. If set, the list does not respond to the | 27 * connecting - a binary attribute. If set, the list does not respond to the |
17 user actions and a spinner is shown near selected device. | 28 user actions and a spinner is shown near selected device. |
18 --> | 29 --> |
19 <polymer-element name="pairing-device-list" | 30 <dom-module name="pairing-device-list"> |
20 attributes="devices selected connecting"> | 31 <link rel="stylesheet" href="pairing_device_list.css"> |
32 | |
33 <iron-iconset-svg name="pairing-device-list-icons"> | |
34 <svg><defs><g id="circle"> | |
35 <circle cx="12" cy="12" r="12"></circle> | |
36 </g></defs></svg> | |
37 </iron-iconset-svg> | |
38 | |
21 <template> | 39 <template> |
22 <link rel="stylesheet" href="pairing_device_list.css"> | 40 <iron-selector selected="{{selected}}" attr-for-selected="name"> |
23 | 41 <template is="dom-repeat" items="[[devices]]"> |
24 <core-iconset-svg id="icon" iconSize="24"> | 42 <paper-icon-item name$="[[item]]" class="relative"> |
25 <svg><defs><g id="circle"> | 43 <iron-icon icon="pairing-device-list-icons:circle" item-icon |
26 <circle cx="12" cy="12" r="12"></circle> | 44 style$="[[getStyleForDeviceIcon_(item)]]"> |
27 </g></defs></svg> | 45 </iron-icon> |
28 </core-iconset-svg> | 46 <div><span>[[item]]</span></div> |
29 | 47 <div class="flex horizontal end-justified layout center"> |
Roman Sorokin (ftl)
2015/06/19 13:10:31
Why do you use classes for layout attributes? In t
dzhioev (left Google)
2015/06/20 02:01:54
There is another way: use layout classes instead o
| |
30 <core-selector selected="{{selected}}"> | |
31 <template repeat="{{device in devices}}"> | |
32 <!-- TODO(dzhioev): replace 'core-item' with 'paper-item'. | |
33 http://crbug.com/423368 --> | |
34 <core-item name="{{device}}" relative> | |
35 <core-icon icon="icon:circle" | |
36 style="color: {{device | colorByName}}"></core-icon> | |
37 <div>{{device}}</div> | |
38 <div flex horizontal end-justified layout center> | |
39 <div class="throbber"></div> | 48 <div class="throbber"></div> |
40 </div> | 49 </div> |
41 </core-item> | 50 </paper-icon-item> |
42 </template> | 51 </template> |
43 </core-selector> | 52 </iron-selector> |
44 </template> | 53 </template> |
45 </polymer-element> | 54 </dom-module> |
46 | 55 |
47 <!-- | 56 <!-- |
48 Single page of the controller's out-of-box flow. | 57 Single page of the controller's out-of-box flow. |
49 The page consists of the top part and the bottom part. | 58 The page consists of the top part and the bottom part. |
50 The top part contains a title of the page. Direct successors of the | 59 The top part contains a title of the page. Direct successors of the |
51 <controller-pairing-page> having 'title' class will be inserted there. | 60 <controller-pairing-page> having 'title' class will be inserted there. |
52 The bottom part contains controls that are aligned right (all the successors | 61 The bottom part contains controls that are aligned right (all the successors |
53 that are <paper-button>s) and a content of the page (all the other successors). | 62 that are <paper-button>s) and a content of the page (all the other successors). |
54 Special case is a help button (<paper-button> with 'help' class set) which | 63 Special case is a help button (<paper-button> with 'help' class set) which |
55 is aligned left. | 64 is aligned left. |
56 There are several classes that can be used to change the page appearance: | 65 There are several classes that can be used to change the page appearance: |
57 * split - if this class is set, top and bottom parts will have different | 66 * split - if this class is set, top and bottom parts will have different |
58 colors. | 67 colors. |
59 * big-font - if this class is set, slightly bigger font is used on page. | 68 * big-font - if this class is set, slightly bigger font is used on page. |
60 * progress - if this class is set and 'split' is not, progress bar is shown | 69 * progress - if this class is set and 'split' is not, progress bar is shown |
61 instead of top and bottom parts separator. | 70 instead of top and bottom parts separator. |
62 | 71 |
63 Also height of the top part can be specified in CSS as follows: | 72 Also height of the top part can be specified in CSS as follows: |
64 | 73 |
65 controller-pairing-page::shadow #top { | 74 controller-pairing-page::shadow #top { |
66 height: 100px; | 75 height: 100px; |
67 } | 76 } |
68 --> | 77 --> |
69 <polymer-element name="controller-pairing-page" noscript> | 78 <dom-module name="controller-pairing-page"> |
79 <link rel="stylesheet" href="controller_pairing_page.css"> | |
80 | |
70 <template> | 81 <template> |
71 <link rel="stylesheet" href="controller_pairing_page.css"> | 82 <div class="vertical layout fit"> |
72 | 83 <div id="top" class="relative vertical end-justified layout"> |
73 <div vertical layout fit> | 84 <div id="title"> |
74 <div id="top" hero hero-id="top" relative vertical end-justified layout> | 85 <content select=".title"></content> |
75 <content select=".title"></content> | 86 </div> |
76 <div id="separator"> | 87 <div id="separator"> |
77 <indeterminate-progress fill runnerColor="white" | 88 <paper-progress indeterminate></paper-progress> |
78 backgroundColor="#87ceac" runnerPortion="40"> | |
79 </indeterminate-progress> | |
80 </div> | 89 </div> |
81 </div> | 90 </div> |
82 <div id="bottom" hero hero-id="bottom" flex vertical layout> | 91 <div id="bottom" class="flex vertical layout"> |
83 <div flex vertical layout> | 92 <div class="flex vertical layout"> |
84 <content select=":not(paper-button)"></content> | 93 <content select=":not(paper-button)"></content> |
85 </div> | 94 </div> |
86 <div id="controls" horizontal layout center> | 95 <div id="controls" class="horizontal layout center"> |
87 <div flex> | 96 <div class="flex"> |
88 <content select="paper-button.help-button"></content> | 97 <content select="paper-button.help-button"></content> |
89 </div> | 98 </div> |
90 <content select="paper-button"></content> | 99 <content select="paper-button"></content> |
91 </div> | 100 </div> |
92 </div> | 101 </div> |
93 </div> | 102 </div> |
94 </template> | 103 </template> |
95 </polymer-element> | 104 </dom-module> |
96 | 105 |
97 <polymer-element name="controller-pairing-screen" extends="oobe-screen"> | 106 <dom-module name="controller-pairing-screen"> |
107 <link rel="stylesheet" href="oobe_screen_controller_pairing.css"> | |
108 | |
98 <template> | 109 <template> |
99 <link rel="stylesheet" href="oobe_screen_controller_pairing.css"> | 110 <paper-material class="fit"> |
100 | 111 <neon-animated-pages id="pages" selected="{{C.page}}" |
Roman Sorokin (ftl)
2015/06/19 13:10:31
nit: Indentation
dzhioev (left Google)
2015/06/20 02:01:54
Done.
| |
101 <template id="help-button"> | 112 attr-for-selected="name" class="fit"> |
102 <paper-button class="help-button" on-tap="{{helpButtonClicked}}"> | |
103 {{'helpBtn' | i18n}} | |
104 </paper-button> | |
105 </template> | |
106 | |
107 <template id="progress"> | |
108 <indeterminate-progress runnerColor="#0f9d58" backgroundColor="#87ceac" | |
109 runnerPortion="23"></indeterminate-progress> | |
110 </template> | |
111 | |
112 <paper-shadow z="1" fit> | |
113 <core-animated-pages transitions="cross-fade-all hero-transition" | |
114 selected="{{C.page}}" fit> | |
115 <controller-pairing-page name="devices-discovery" class="big-font"> | 113 <controller-pairing-page name="devices-discovery" class="big-font"> |
116 <div class="title">{{'welcomeTitle' | i18n}}</div> | 114 <div class="title" |
117 <div>{{'searching' | i18n}}</div> | 115 i18n-content="login_ControllerPairingScreen_welcomeTitle"> |
118 <template bind ref="help-button"></template> | 116 </div> |
117 <div i18n-content="login_ControllerPairingScreen_searching"></div> | |
118 <paper-button class="help-button" on-tap="helpButtonClicked_" | |
119 i18n-content="login_ControllerPairingScreen_helpBtn"> | |
120 </paper-button> | |
119 </controller-pairing-page> | 121 </controller-pairing-page> |
120 | 122 |
121 <controller-pairing-page name="device-select" class="split"> | 123 <controller-pairing-page name="device-select" class="split"> |
122 <div class="title">{{'selectTitle' | i18n}}</div> | 124 <div class="title" |
123 <pairing-device-list devices="{{C.devices}}" | 125 i18n-content="login_ControllerPairingScreen_selectTitle"> |
124 selected="{{selectedDevice}}"></pairing-device-list> | 126 </div> |
125 <template bind ref="help-button"></template> | 127 <pairing-device-list devices="[[C.devices]]" |
126 <paper-button on-tap="{{userActed}}" action="chooseDevice" | 128 selected="{{selectedDevice}}"> |
127 disabled?="{{C.controlsDisabled}}"> | 129 </pairing-device-list> |
128 {{'connectBtn' | i18n}} | 130 <paper-button class="help-button" on-tap="helpButtonClicked_" |
131 i18n-content="login_ControllerPairingScreen_helpBtn"> | |
132 </paper-button> | |
133 <paper-button on-tap="userActed" action="chooseDevice" | |
134 disabled$="[[C.controlsDisabled]]" | |
135 i18n-content="login_ControllerPairingScreen_connectBtn"> | |
129 </paper-button> | 136 </paper-button> |
130 </controller-pairing-page> | 137 </controller-pairing-page> |
131 | 138 |
132 <controller-pairing-page name="device-not-found"> | 139 <controller-pairing-page name="device-not-found"> |
133 <div class="title">{{'troubleConnectingTitle' | i18n}}</div> | 140 <div class="title" |
134 <div>{{'connectingAdvice' | i18n}}</div> | 141 i18n-content="login_ControllerPairingScreen_troubleConnectingTitle"> |
135 <paper-button on-tap="{{userActed}}" action="repeatDiscovery"> | 142 </div> |
136 {{'adviceGotItBtn' | i18n}} | 143 <div i18n-content="login_ControllerPairingScreen_connectingAdvice"> |
144 </div> | |
145 <paper-button on-tap="userActed" action="repeatDiscovery" | |
146 i18n-content="login_ControllerPairingScreen_adviceGotItBtn"> | |
137 </paper-button> | 147 </paper-button> |
138 </controller-pairing-page> | 148 </controller-pairing-page> |
139 | 149 |
140 <controller-pairing-page name="establishing-connection" class="split"> | 150 <controller-pairing-page name="establishing-connection" class="split"> |
141 <div class="title">{{'selectTitle' | i18n}}</div> | 151 <div class="title" |
142 <pairing-device-list devices="{{C.devices}}" | 152 i18n-content="login_ControllerPairingScreen_selectTitle"> |
143 selected="{{selectedDevice}}" connecting></pairing-device-list> | 153 </div> |
144 <template bind ref="help-button"></template> | 154 <pairing-device-list devices="[[C.devices]]" |
145 <paper-button disabled>{{'connecting' | i18n}}</paper-button> | 155 selected="{{selectedDevice}}" connecting> |
156 </pairing-device-list> | |
157 <paper-button class="help-button" on-tap="helpButtonClicked_" | |
158 i18n-content="login_ControllerPairingScreen_helpBtn"> | |
159 </paper-button> | |
160 <paper-button disabled | |
161 i18n-content="login_ControllerPairingScreen_connecting"> | |
162 </paper-button> | |
146 </controller-pairing-page> | 163 </controller-pairing-page> |
147 | 164 |
148 <controller-pairing-page name="establishing-connection-error"> | 165 <controller-pairing-page name="establishing-connection-error"> |
149 <!-- TODO(dzhioev): Strings TBD. http://crbug.com/423740 --> | 166 <!-- TODO(dzhioev): Strings TBD. http://crbug.com/423740 --> |
150 <div class="title">Unable to connect to {{selectedDevice}}</div> | 167 <div class="title"> |
151 <paper-button on-tap="{{userActed}}" action="repeatDiscovery"> | 168 Unable to connect to <span>[[selectedDevice]]<span> |
169 </div> | |
170 <paper-button on-tap="userActed" action="repeatDiscovery"> | |
152 Repeat discovery | 171 Repeat discovery |
153 </paper-button> | 172 </paper-button> |
154 </controller-pairing-page> | 173 </controller-pairing-page> |
155 | 174 |
156 <controller-pairing-page name="code-confirmation" class="split"> | 175 <controller-pairing-page name="code-confirmation" class="split"> |
157 <div class="title">{{'confirmationTitle' | i18n}}</div> | 176 <div class="title" |
158 <div>{{'confirmationQuestion' | i18n}}</div> | 177 i18n-content="login_ControllerPairingScreen_confirmationTitle"> |
159 <div id="code">{{C.code}}</div> | 178 </div> |
160 <paper-button on-tap="{{userActed}}" action="rejectCode" | 179 <div i18n-content="login_ControllerPairingScreen_confirmationQuestion"> |
161 disabled?="{{C.controlsDisabled}}"> | 180 </div> |
162 {{'rejectCodeBtn' | i18n}} | 181 <div id="code"><span>[[C.code]]</span></div> |
182 <paper-button on-tap="userActed" action="rejectCode" | |
183 disabled$="[[C.controlsDisabled]" | |
184 i18n-content="login_ControllerPairingScreen_rejectCodeBtn"> | |
163 </paper-button> | 185 </paper-button> |
164 <paper-button on-tap="{{userActed}}" action="acceptCode" | 186 <paper-button on-tap="userActed" action="acceptCode" |
165 disabled?="{{C.controlsDisabled}}"> | 187 disabled$="[[C.controlsDisabled]]" |
166 {{'acceptCodeBtn' | i18n}} | 188 i18n-content="login_ControllerPairingScreen_acceptCodeBtn"> |
167 </paper-button> | 189 </paper-button> |
168 </controller-pairing-page> | 190 </controller-pairing-page> |
169 | 191 |
170 <controller-pairing-page name="host-update" class="split"> | 192 <controller-pairing-page name="host-update" class="split"> |
171 <div class="title">{{'updateTitle' | i18n}}</div> | 193 <div class="title" |
172 <div>{{'updateText' | i18n}}</div> | 194 i18n-content="login_ControllerPairingScreen_updateTitle"> |
173 <template bind ref="progress"></template> | 195 </div> |
196 <div i18n-content="login_ControllerPairingScreen_updateText"></div> | |
197 <paper-progress indeterminate></paper-progress> | |
174 </controller-pairing-page> | 198 </controller-pairing-page> |
175 | 199 |
176 <controller-pairing-page name="host-connection-lost" class="split"> | 200 <controller-pairing-page name="host-connection-lost" class="split"> |
177 <div class="title">{{'connectionLostTitle' | i18n}}</div> | 201 <div class="title" |
178 <div>{{'connectionLostText' | i18n}}</div> | 202 i18n-content="login_ControllerPairingScreen_connectionLostTitle"> |
179 <template bind ref="progress"></template> | 203 </div> |
204 <div i18n-content="login_ControllerPairingScreen_connectionLostText"> | |
205 </div> | |
206 <paper-progress indeterminate></paper-progress> | |
180 </controller-pairing-page> | 207 </controller-pairing-page> |
181 | 208 |
182 <controller-pairing-page name="enrollment-introduction" class="split"> | 209 <controller-pairing-page name="enrollment-introduction" class="split"> |
183 <div class="title">{{'enrollTitle' | i18n}}</div> | 210 <div class="title" |
184 <p>{{'enrollText1' | i18n}}</p> | 211 i18n-content="login_ControllerPairingScreen_enrollTitle"> |
185 <p><strong>{{'enrollText2' | i18n}}</strong></p> | 212 </div> |
186 <paper-button on-click="{{userActed}}" action="proceedToAuthentication" | 213 <p i18n-content="login_ControllerPairingScreen_enrollText1"></p> |
187 disabled?="{{C.controlsDisabled}}"> | 214 <p> |
188 {{'continueBtn' | i18n}} | 215 <strong i18n-content="login_ControllerPairingScreen_enrollText2"> |
216 </strong> | |
217 </p> | |
218 <paper-button on-tap="userActed" action="proceedToAuthentication" | |
219 disabled$="[[C.controlsDisabled]]" | |
220 i18n-content="login_ControllerPairingScreen_continueBtn"> | |
189 </paper-button> | 221 </paper-button> |
190 </controller-pairing-page> | 222 </controller-pairing-page> |
191 | 223 |
192 <controller-pairing-page name="authentication" class="split"> | 224 <controller-pairing-page name="authentication" class="split"> |
193 <div class="title">{{'enrollTitle' | i18n}}</div> | 225 <div class="title" |
226 i18n-content="login_ControllerPairingScreen_enrollTitle"> | |
227 </div> | |
194 <div>Not implemented.</div> | 228 <div>Not implemented.</div> |
195 </controller-pairing-page> | 229 </controller-pairing-page> |
196 | 230 |
197 <controller-pairing-page name="host-enrollment" class="progress"> | 231 <controller-pairing-page name="host-enrollment" class="progress"> |
198 <!-- 'enrollmentTitle' contains <strong> tag. --> | 232 <!-- This title contains <strong> tag inside. --> |
199 <html-echo class="title" | 233 <html-echo class="title" |
200 content="{{['enrollmentInProgress', C.enrollmentDomain] | i18n}}"> | 234 content="[[getHostEnrollmentStepTitle_(C.enrollmentDomain)]]"> |
201 </html-echo> | 235 </html-echo> |
202 </controller-pairing-page> | 236 </controller-pairing-page> |
203 | 237 |
204 <controller-pairing-page name="host-enrollment-error" class="progress"> | 238 <controller-pairing-page name="host-enrollment-error" class="progress"> |
205 <div class="title">{{'enrollmentErrorTitle' | i18n}}</div> | 239 <div class="title" |
206 <div>{{'enrollmentErrorHostRestarts' | i18n}}</div> | 240 i18n-content="login_ControllerPairingScreen_enrollmentErrorTitle"> |
241 </div> | |
242 <div i18n-content="login_ControllerPairingScreen_enrollmentErrorHostRest arts"> | |
243 </div> | |
207 </controller-pairing-page> | 244 </controller-pairing-page> |
208 | 245 |
209 <controller-pairing-page name="pairing-done" class="big-font"> | 246 <controller-pairing-page name="pairing-done" class="big-font"> |
210 <div class="title">{{'successTitle' | i18n}}</div> | 247 <div class="title" |
211 <div>{{['successText', selectedDevice] | i18n}}</div> | 248 i18n-content="login_ControllerPairingScreen_successTitle"> |
212 <paper-button on-click="{{userActed}}" action="startSession" | 249 </div> |
213 disabled?="{{C.controlsDisabled}}"> | 250 <div><span>[[getSuccessMessage_(selectedDevice)]]</div> |
214 {{'continueToHangoutsBtn' | i18n}} | 251 <paper-button on-tap="userActed" action="startSession" |
252 disabled$="{{C.controlsDisabled}}" | |
253 i18n-content="login_ControllerPairingScreen_continueToHangoutsBtn"> | |
215 </paper-button> | 254 </paper-button> |
216 </controller-pairing-page> | 255 </controller-pairing-page> |
217 </core-animated-pages> | 256 </neon-animated-pages> |
218 </paper-shadow> | 257 </paper-shadow> |
Roman Sorokin (ftl)
2015/06/19 13:10:31
Is it closing <paper-material>?
dzhioev (left Google)
2015/06/20 02:01:54
Nice catch. Done.
| |
219 </template> | 258 </template> |
220 </polymer-element> | 259 </dom-module> |
260 | |
OLD | NEW |