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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
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 }); | 87 }); |
93 | 88 |
94 Oobe.initializeA11yMenu(); | 89 Oobe.initializeA11yMenu(); |
95 | 90 |
96 $('security-ok-button').addEventListener('click', function(event) { | |
97 $('popup-overlay').hidden = true; | |
98 }); | |
99 | |
100 // Do not allow focus leaving the overlay. | |
101 $('popup-overlay').addEventListener('focusout', function(event) { | |
102 // WebKit does not allow immediate focus return. | |
103 setTimeout(function() { $('security-ok-button').focus(); }, 0); | |
104 event.preventDefault(); | |
105 }); | |
106 | |
107 chrome.send('screenStateInitialize'); | 91 chrome.send('screenStateInitialize'); |
108 }; | 92 }; |
109 | 93 |
110 /** | 94 /** |
111 * Initializes OOBE accessibility menu. | 95 * Initializes OOBE accessibility menu. |
112 */ | 96 */ |
113 Oobe.initializeA11yMenu = function() { | 97 Oobe.initializeA11yMenu = function() { |
114 cr.ui.Bubble.decorate($('accessibility-menu')); | 98 cr.ui.Bubble.decorate($('accessibility-menu')); |
115 $('connect-accessibility-link').addEventListener( | 99 $('connect-accessibility-link').addEventListener( |
116 'click', Oobe.handleAccessbilityLinkClick); | 100 'click', Oobe.handleAccessbilityLinkClick); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // Allow selection events on components with editable text (password field) | 438 // Allow selection events on components with editable text (password field) |
455 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 439 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
456 disableTextSelectAndDrag(function(e) { | 440 disableTextSelectAndDrag(function(e) { |
457 var src = e.target; | 441 var src = e.target; |
458 return src instanceof HTMLTextAreaElement || | 442 return src instanceof HTMLTextAreaElement || |
459 src instanceof HTMLInputElement && | 443 src instanceof HTMLInputElement && |
460 /text|password|search/.test(src.type); | 444 /text|password|search/.test(src.type); |
461 }); | 445 }); |
462 | 446 |
463 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); | 447 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); |
OLD | NEW |