OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 Out of the box experience flow (OOBE). | 6 * @fileoverview Out of the box experience flow (OOBE). |
7 * This is the main code for the OOBE WebUI implementation. | 7 * This is the main code for the OOBE WebUI implementation. |
8 */ | 8 */ |
9 | 9 |
10 var localStrings = new LocalStrings(); | 10 var localStrings = new LocalStrings(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 oobe.ResetScreen.register(); | 72 oobe.ResetScreen.register(); |
73 login.AccountPickerScreen.register(); | 73 login.AccountPickerScreen.register(); |
74 login.GaiaSigninScreen.register(); | 74 login.GaiaSigninScreen.register(); |
75 oobe.UserImageScreen.register(/* lazyInit= */ false); | 75 oobe.UserImageScreen.register(/* lazyInit= */ false); |
76 login.ErrorMessageScreen.register(); | 76 login.ErrorMessageScreen.register(); |
77 login.TPMErrorMessageScreen.register(); | 77 login.TPMErrorMessageScreen.register(); |
78 | 78 |
79 cr.ui.Bubble.decorate($('bubble')); | 79 cr.ui.Bubble.decorate($('bubble')); |
80 login.HeaderBar.decorate($('login-header-bar')); | 80 login.HeaderBar.decorate($('login-header-bar')); |
81 | 81 |
82 // TODO: Cleanup with old OOBE style removal. | 82 // TODO: Cleanup with old OOBE style removal. |
Nikita (slow)
2012/11/29 11:17:48
nit: This TODO could be removed.
Ivan Korotkov
2012/11/29 17:42:28
It's related to #security-link, which is still the
| |
83 $('security-link').addEventListener('click', function(event) { | 83 $('security-link').addEventListener('click', function(event) { |
84 chrome.send('eulaOnTpmPopupOpened'); | 84 chrome.send('eulaOnInstallationSettingsPopupOpened'); |
85 $('popup-overlay').hidden = false; | 85 $('popup-overlay').hidden = false; |
86 $('security-ok-button').focus(); | 86 $('installation-settings-ok-button').focus(); |
87 }); | |
88 $('security-tpm-link').addEventListener('click', function(event) { | |
89 chrome.send('eulaOnTpmPopupOpened'); | |
90 $('popup-overlay').hidden = false; | |
91 $('security-ok-button').focus(); | |
92 }); | |
93 $('security-ok-button').addEventListener('click', function(event) { | |
94 $('popup-overlay').hidden = true; | |
95 }); | |
96 // Do not allow focus leaving the overlay. | |
97 $('popup-overlay').addEventListener('focusout', function(event) { | |
98 // WebKit does not allow immediate focus return. | |
99 setTimeout(function() { $('security-ok-button').focus(); }, 0); | |
100 event.preventDefault(); | |
101 }); | 87 }); |
102 | 88 |
103 chrome.send('screenStateInitialize'); | 89 chrome.send('screenStateInitialize'); |
104 }; | 90 }; |
105 | 91 |
106 /** | 92 /** |
107 * Handle accelerators. These are passed from native code instead of a JS | 93 * Handle accelerators. These are passed from native code instead of a JS |
108 * event handler in order to make sure that embedded iframes cannot swallow | 94 * event handler in order to make sure that embedded iframes cannot swallow |
109 * them. | 95 * them. |
110 * @param {string} name Accelerator name. | 96 * @param {string} name Accelerator name. |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 // Allow selection events on components with editable text (password field) | 368 // Allow selection events on components with editable text (password field) |
383 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 369 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
384 disableTextSelectAndDrag(function(e) { | 370 disableTextSelectAndDrag(function(e) { |
385 var src = e.target; | 371 var src = e.target; |
386 return src instanceof HTMLTextAreaElement || | 372 return src instanceof HTMLTextAreaElement || |
387 src instanceof HTMLInputElement && | 373 src instanceof HTMLInputElement && |
388 /text|password|search/.test(src.type); | 374 /text|password|search/.test(src.type); |
389 }); | 375 }); |
390 | 376 |
391 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); | 377 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); |
OLD | NEW |