OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 Common OOBE controller methods. | 6 * @fileoverview Common OOBE controller methods. |
7 */ | 7 */ |
8 | 8 |
9 <include src="test_util.js"> | 9 <include src="test_util.js"> |
10 <include src="../../../../../ui/login/screen.js"> | 10 <include src="../../../../../ui/login/screen.js"> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 /** | 89 /** |
90 * Update body class to switch between OOBE UI and Login UI. | 90 * Update body class to switch between OOBE UI and Login UI. |
91 */ | 91 */ |
92 Oobe.showOobeUI = function(showOobe) { | 92 Oobe.showOobeUI = function(showOobe) { |
93 if (showOobe) { | 93 if (showOobe) { |
94 document.body.classList.add('oobe-display'); | 94 document.body.classList.add('oobe-display'); |
95 | 95 |
96 // Callback to animate the header bar in. | 96 // Callback to animate the header bar in. |
97 var showHeaderBar = function() { | 97 var showHeaderBar = function() { |
98 login.HeaderBar.animateIn(function() { | 98 login.HeaderBar.animateIn(false, function() { |
99 chrome.send('headerBarVisible'); | 99 chrome.send('headerBarVisible'); |
100 }); | 100 }); |
101 }; | 101 }; |
102 // Start asynchronously so the OOBE network screen comes in first. | 102 // Start asynchronously so the OOBE network screen comes in first. |
103 window.setTimeout(showHeaderBar, HEADER_BAR_DELAY_MS); | 103 window.setTimeout(showHeaderBar, HEADER_BAR_DELAY_MS); |
104 } else { | 104 } else { |
105 document.body.classList.remove('oobe-display'); | 105 document.body.classList.remove('oobe-display'); |
106 Oobe.getInstance().prepareForLoginDisplay_(); | 106 Oobe.getInstance().prepareForLoginDisplay_(); |
107 // Ensure header bar is visible when switching to Login UI from oobe. | 107 // Ensure header bar is visible when switching to Login UI from oobe. |
108 if (Oobe.getInstance().displayType == DISPLAY_TYPE.OOBE) | 108 if (Oobe.getInstance().displayType == DISPLAY_TYPE.OOBE) |
109 login.HeaderBar.animateIn(); | 109 login.HeaderBar.animateIn(true); |
110 } | 110 } |
111 | 111 |
112 Oobe.getInstance().headerHidden = false; | 112 Oobe.getInstance().headerHidden = false; |
113 }; | 113 }; |
114 | 114 |
115 /** | 115 /** |
116 * When |showShutdown| is set to "true", the shutdown button is shown and the | 116 * When |showShutdown| is set to "true", the shutdown button is shown and the |
117 * reboot button hidden. If set to "false", the reboot button is visible and | 117 * reboot button hidden. If set to "false", the reboot button is visible and |
118 * the shutdown button hidden. | 118 * the shutdown button hidden. |
119 */ | 119 */ |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 Oobe.animateAuthenticationSuccess = function() { | 204 Oobe.animateAuthenticationSuccess = function() { |
205 login.HeaderBar.animateOut(function() { | 205 login.HeaderBar.animateOut(function() { |
206 chrome.send('unlockOnLoginSuccess'); | 206 chrome.send('unlockOnLoginSuccess'); |
207 }); | 207 }); |
208 }; | 208 }; |
209 | 209 |
210 /** | 210 /** |
211 * Displays animations that have to happen once login UI is fully displayed. | 211 * Displays animations that have to happen once login UI is fully displayed. |
212 */ | 212 */ |
213 Oobe.animateOnceFullyDisplayed = function() { | 213 Oobe.animateOnceFullyDisplayed = function() { |
214 login.HeaderBar.animateIn(); | 214 login.HeaderBar.animateIn(true, function() { |
| 215 chrome.send('headerBarVisible'); |
| 216 }); |
215 }; | 217 }; |
216 | 218 |
217 /** | 219 /** |
218 * Sets text content for a div with |labelId|. | 220 * Sets text content for a div with |labelId|. |
219 * @param {string} labelId Id of the label div. | 221 * @param {string} labelId Id of the label div. |
220 * @param {string} labelText Text for the label. | 222 * @param {string} labelText Text for the label. |
221 */ | 223 */ |
222 Oobe.setLabelText = function(labelId, labelText) { | 224 Oobe.setLabelText = function(labelId, labelText) { |
223 DisplayManager.setLabelText(labelId, labelText); | 225 DisplayManager.setLabelText(labelId, labelText); |
224 }; | 226 }; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 document.addEventListener('DOMContentLoaded', function() { | 398 document.addEventListener('DOMContentLoaded', function() { |
397 if (!window['WAIT_FOR_POLYMER']) { | 399 if (!window['WAIT_FOR_POLYMER']) { |
398 initializeOobe(); | 400 initializeOobe(); |
399 return; | 401 return; |
400 } | 402 } |
401 window.addEventListener('polymer-ready', function() { | 403 window.addEventListener('polymer-ready', function() { |
402 initializeOobe(); | 404 initializeOobe(); |
403 }); | 405 }); |
404 }); | 406 }); |
405 })(); | 407 })(); |
OLD | NEW |