Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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. This method is shared between | 6 * @fileoverview Common OOBE controller methods. This method is shared between |
| 7 * OOBE, login, and the lock screen. Add only methods that need to be shared | 7 * OOBE, login, and the lock screen. Add only methods that need to be shared |
| 8 * between all *three* screens here, as each additional method increases the | 8 * between all *three* screens here, as each additional method increases the |
| 9 * time it takes to show the lock screen. | 9 * time it takes to show the lock screen. |
| 10 * | 10 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 * Delay in milliseconds between start of OOBE animation and start of | 43 * Delay in milliseconds between start of OOBE animation and start of |
| 44 * header bar animation. | 44 * header bar animation. |
| 45 */ | 45 */ |
| 46 var HEADER_BAR_DELAY_MS = 300; | 46 var HEADER_BAR_DELAY_MS = 300; |
| 47 | 47 |
| 48 cr.addSingletonGetter(Oobe); | 48 cr.addSingletonGetter(Oobe); |
| 49 | 49 |
| 50 Oobe.prototype = { | 50 Oobe.prototype = { |
| 51 __proto__: DisplayManager.prototype, | 51 __proto__: DisplayManager.prototype, |
| 52 }; | 52 }; |
| 53 | 53 |
|
Shuhei Takahashi
2017/04/07 04:37:59
Could you define Oobe.readyForTesting here with JS
hidehiko
2017/04/07 06:37:59
Done.
| |
| 54 /** | 54 /** |
| 55 * Handle accelerators. These are passed from native code instead of a JS | 55 * Handle accelerators. These are passed from native code instead of a JS |
| 56 * event handler in order to make sure that embedded iframes cannot swallow | 56 * event handler in order to make sure that embedded iframes cannot swallow |
| 57 * them. | 57 * them. |
| 58 * @param {string} name Accelerator name. | 58 * @param {string} name Accelerator name. |
| 59 */ | 59 */ |
| 60 Oobe.handleAccelerator = function(name) { | 60 Oobe.handleAccelerator = function(name) { |
| 61 Oobe.getInstance().handleAccelerator(name); | 61 Oobe.getInstance().handleAccelerator(name); |
| 62 }; | 62 }; |
| 63 | 63 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 src instanceof HTMLInputElement && | 433 src instanceof HTMLInputElement && |
| 434 /text|password|search/.test(src.type); | 434 /text|password|search/.test(src.type); |
| 435 }); | 435 }); |
| 436 | 436 |
| 437 | 437 |
| 438 (function() { | 438 (function() { |
| 439 'use strict'; | 439 'use strict'; |
| 440 | 440 |
| 441 document.addEventListener('DOMContentLoaded', function() { | 441 document.addEventListener('DOMContentLoaded', function() { |
| 442 Oobe.initialize(); | 442 Oobe.initialize(); |
| 443 | |
| 444 // Some ForTesting APIs directly access to DOM. Because this script | |
| 445 // is loaded in header, DOM tree may not be available at beginning. | |
| 446 // initialize() is called on DOMContentLoaded, so here mark ready, | |
| 447 // and let the external script wait for this condition. | |
| 448 Oobe.readyForTesting = true; | |
| 443 }); | 449 }); |
| 444 | 450 |
| 445 // Install a global error handler so stack traces are included in logs. | 451 // Install a global error handler so stack traces are included in logs. |
| 446 window.onerror = function(message, file, line, column, error) { | 452 window.onerror = function(message, file, line, column, error) { |
| 447 console.error(error.stack); | 453 console.error(error.stack); |
| 448 } | 454 } |
| 449 })(); | 455 })(); |
| 450 | |
| OLD | NEW |