Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js

Issue 11421111: Fixed button focusing in OOBE screens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up the code. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 cr.define('oobe', function() { 5 cr.define('oobe', function() {
6 /** 6 /**
7 * Creates a new oobe screen div. 7 * Creates a new oobe screen div.
8 * @constructor 8 * @constructor
9 * @extends {HTMLDivElement} 9 * @extends {HTMLDivElement}
10 */ 10 */
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 * Buttons in oobe wizard's button strip. 103 * Buttons in oobe wizard's button strip.
104 * @type {array} Array of Buttons. 104 * @type {array} Array of Buttons.
105 */ 105 */
106 get buttons() { 106 get buttons() {
107 var buttons = []; 107 var buttons = [];
108 108
109 var cancelButton = this.ownerDocument.createElement('button'); 109 var cancelButton = this.ownerDocument.createElement('button');
110 cancelButton.id = 'oauth-enroll-cancel-button'; 110 cancelButton.id = 'oauth-enroll-cancel-button';
111 cancelButton.textContent = 111 cancelButton.textContent =
112 localStrings.getString('oauthEnrollCancel'); 112 localStrings.getString('oauthEnrollCancel');
113 cancelButton.autofocus = true;
Nikita (slow) 2012/11/28 18:26:26 Not sure that we would want to autofocus this butt
mtomasz 2012/11/28 21:57:42 Done. If we want it to be focused, then it will be
Nikita (slow) 2012/11/29 16:08:11 Did you try Ctrl+Alt+E shortcut. You should launc
mtomasz 2012/11/29 19:04:28 I've tested and removed the change from this file
113 cancelButton.addEventListener('click', function(e) { 114 cancelButton.addEventListener('click', function(e) {
114 chrome.send('oauthEnrollClose', ['cancel']); 115 chrome.send('oauthEnrollClose', ['cancel']);
115 }); 116 });
116 buttons.push(cancelButton); 117 buttons.push(cancelButton);
117 118
118 var tryAgainButton = this.ownerDocument.createElement('button'); 119 var tryAgainButton = this.ownerDocument.createElement('button');
119 tryAgainButton.id = 'oauth-enroll-try-again-button'; 120 tryAgainButton.id = 'oauth-enroll-try-again-button';
120 tryAgainButton.hidden = true; 121 tryAgainButton.hidden = true;
121 tryAgainButton.textContent = 122 tryAgainButton.textContent =
122 localStrings.getString('oauthEnrollRetry'); 123 localStrings.getString('oauthEnrollRetry');
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 */ 213 */
213 showStep: function(step) { 214 showStep: function(step) {
214 $('oauth-enroll-cancel-button').hidden = true; 215 $('oauth-enroll-cancel-button').hidden = true;
215 $('oauth-enroll-try-again-button').hidden = true; 216 $('oauth-enroll-try-again-button').hidden = true;
216 $('oauth-enroll-explain-button').hidden = true; 217 $('oauth-enroll-explain-button').hidden = true;
217 $('oauth-enroll-done-button').hidden = true; 218 $('oauth-enroll-done-button').hidden = true;
218 for (var i = 0; i < this.steps_.length; i++) { 219 for (var i = 0; i < this.steps_.length; i++) {
219 var theStep = this.steps_[i]; 220 var theStep = this.steps_[i];
220 var active = (theStep.name == step); 221 var active = (theStep.name == step);
221 $('oauth-enroll-step-' + theStep.name).hidden = !active; 222 $('oauth-enroll-step-' + theStep.name).hidden = !active;
222 if (active && theStep.button) { 223 if (theStep.button) {
223 var button = $('oauth-enroll-' + theStep.button + '-button'); 224 var button = $('oauth-enroll-' + theStep.button + '-button');
224 button.hidden = false; 225 button.autofocus = false;
225 if (theStep.focusButton) 226 if (active) {
226 button.focus(); 227 button.hidden = false;
228 if (theStep.focusButton) {
229 button.focus();
230 button.autofocus = true;
231 }
232 }
227 } 233 }
228 } 234 }
229 }, 235 },
230 236
231 /** 237 /**
232 * Sets an error message and switches to the error screen. 238 * Sets an error message and switches to the error screen.
233 * @param {string} message the error message. 239 * @param {string} message the error message.
234 * @param {boolean} retry whether the retry link should be shown. 240 * @param {boolean} retry whether the retry link should be shown.
235 */ 241 */
236 showError: function(message, retry) { 242 showError: function(message, retry) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 var msg = m.data; 309 var msg = m.data;
304 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) 310 if (msg.method == 'completeLogin' && this.isSigninMessage_(m))
305 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]); 311 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]);
306 } 312 }
307 }; 313 };
308 314
309 return { 315 return {
310 OAuthEnrollmentScreen: OAuthEnrollmentScreen 316 OAuthEnrollmentScreen: OAuthEnrollmentScreen
311 }; 317 };
312 }); 318 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698