OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Account picker screen implementation. | 6 * @fileoverview Account picker screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('AccountPickerScreen', 'account-picker', function() { | 9 login.createScreen('AccountPickerScreen', 'account-picker', function() { |
10 /** | 10 /** |
(...skipping 11 matching lines...) Expand all Loading... |
22 'setShouldShowApps', | 22 'setShouldShowApps', |
23 'showAppError', | 23 'showAppError', |
24 'updateUserImage', | 24 'updateUserImage', |
25 'setCapsLockState', | 25 'setCapsLockState', |
26 'forceLockedUserPodFocus', | 26 'forceLockedUserPodFocus', |
27 'removeUser', | 27 'removeUser', |
28 'showBannerMessage', | 28 'showBannerMessage', |
29 'showUserPodCustomIcon', | 29 'showUserPodCustomIcon', |
30 'hideUserPodCustomIcon', | 30 'hideUserPodCustomIcon', |
31 'setAuthType', | 31 'setAuthType', |
| 32 'setTouchViewState', |
32 'setPublicSessionDisplayName', | 33 'setPublicSessionDisplayName', |
33 'setPublicSessionLocales', | 34 'setPublicSessionLocales', |
34 'setPublicSessionKeyboardLayouts', | 35 'setPublicSessionKeyboardLayouts', |
35 ], | 36 ], |
36 | 37 |
37 preferredWidth_: 0, | 38 preferredWidth_: 0, |
38 preferredHeight_: 0, | 39 preferredHeight_: 0, |
39 | 40 |
40 // Whether this screen is shown for the first time. | 41 // Whether this screen is shown for the first time. |
41 firstShown_: true, | 42 firstShown_: true, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // In case of the preselected pod onShow will be called once pod | 107 // In case of the preselected pod onShow will be called once pod |
107 // receives focus. | 108 // receives focus. |
108 if (!podRow.preselectedPod) | 109 if (!podRow.preselectedPod) |
109 this.onShow(); | 110 this.onShow(); |
110 }, | 111 }, |
111 | 112 |
112 /** | 113 /** |
113 * Event handler invoked when the page is shown and ready. | 114 * Event handler invoked when the page is shown and ready. |
114 */ | 115 */ |
115 onShow: function() { | 116 onShow: function() { |
| 117 chrome.send('getTouchViewState'); |
116 if (!this.firstShown_) return; | 118 if (!this.firstShown_) return; |
117 this.firstShown_ = false; | 119 this.firstShown_ = false; |
118 | 120 |
119 // Ensure that login is actually visible. | 121 // Ensure that login is actually visible. |
120 window.requestAnimationFrame(function() { | 122 window.requestAnimationFrame(function() { |
121 chrome.send('accountPickerReady'); | 123 chrome.send('accountPickerReady'); |
122 chrome.send('loginVisible', ['account-picker']); | 124 chrome.send('loginVisible', ['account-picker']); |
123 }); | 125 }); |
124 }, | 126 }, |
125 | 127 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 * @param {string} username Username of selected user | 299 * @param {string} username Username of selected user |
298 * @param {number} authType Authentication type, must be a valid value in | 300 * @param {number} authType Authentication type, must be a valid value in |
299 * the AUTH_TYPE enum in user_pod_row.js. | 301 * the AUTH_TYPE enum in user_pod_row.js. |
300 * @param {string} value The initial value to use for authentication. | 302 * @param {string} value The initial value to use for authentication. |
301 */ | 303 */ |
302 setAuthType: function(username, authType, value) { | 304 setAuthType: function(username, authType, value) { |
303 $('pod-row').setAuthType(username, authType, value); | 305 $('pod-row').setAuthType(username, authType, value); |
304 }, | 306 }, |
305 | 307 |
306 /** | 308 /** |
| 309 * Sets the state of touch view mode. |
| 310 * @param {boolean} isTouchViewEnabled true if the mode is on. |
| 311 */ |
| 312 setTouchViewState: function(isTouchViewEnabled) { |
| 313 $('pod-row').setTouchViewState(isTouchViewEnabled); |
| 314 }, |
| 315 |
| 316 /** |
307 * Updates the display name shown on a public session pod. | 317 * Updates the display name shown on a public session pod. |
308 * @param {string} userID The user ID of the public session | 318 * @param {string} userID The user ID of the public session |
309 * @param {string} displayName The new display name | 319 * @param {string} displayName The new display name |
310 */ | 320 */ |
311 setPublicSessionDisplayName: function(userID, displayName) { | 321 setPublicSessionDisplayName: function(userID, displayName) { |
312 $('pod-row').setPublicSessionDisplayName(userID, displayName); | 322 $('pod-row').setPublicSessionDisplayName(userID, displayName); |
313 }, | 323 }, |
314 | 324 |
315 /** | 325 /** |
316 * Updates the list of locales available for a public session. | 326 * Updates the list of locales available for a public session. |
(...skipping 19 matching lines...) Expand all Loading... |
336 * @param {string} locale The locale to which this list of keyboard layouts | 346 * @param {string} locale The locale to which this list of keyboard layouts |
337 * applies | 347 * applies |
338 * @param {!Object} list List of available keyboard layouts | 348 * @param {!Object} list List of available keyboard layouts |
339 */ | 349 */ |
340 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 350 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
341 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 351 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
342 } | 352 } |
343 }; | 353 }; |
344 }); | 354 }); |
345 | 355 |
OLD | NEW |