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

Unified Diff: chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js

Issue 2688153004: ChromeOS OOBE: fix focus flow in MD-OOBE. (Closed)
Patch Set: Rebased. Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js b/chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js
index f969be3f83ee10a663cb940d1e532f2c4c16cb39..2ee303968e6fdad9b71eb422e04e9842fe2c37c6 100644
--- a/chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js
+++ b/chrome/browser/resources/chromeos/login/oobe_welcome_dialog.js
@@ -12,6 +12,7 @@ Polymer({
type: String,
value: '',
},
+
/**
* Controls visibility of "Timezone" button.
*/
@@ -26,19 +27,29 @@ Polymer({
debuggingLinkVisible: Boolean,
},
+ /**
+ * This is stored ID of currently focused element to restore id on returns
+ * to this dialog from Language / Timezone Selection dialogs.
+ */
+ focusedElement_: 'languageSelectionButton',
+
onLanguageClicked_: function() {
+ this.focusedElement_ = "languageSelectionButton";
this.fire('language-button-clicked');
},
onAccessibilityClicked_: function() {
+ this.focusedElement_ = "accessibilitySettingsButton";
this.fire('accessibility-button-clicked');
},
onTimezoneClicked_: function() {
+ this.focusedElement_ = "timezoneSettingsButton";
this.fire('timezone-button-clicked');
},
onNextClicked_: function() {
+ this.focusedElement_ = "welcomeNextButton";
this.fire('next-button-clicked');
},
@@ -47,6 +58,23 @@ Polymer({
['connect-debugging-features']);
},
+ attached: function() {
+ this.focus();
+ },
+
+ focus: function() {
+ var focusedElement = this.$[this.focusedElement_];
+ if (focusedElement)
+ focusedElement.focus();
+ },
+
+ /**
+ * This is called from oobe_welcome when this dialog is shown.
+ */
+ show: function() {
+ this.focus();
+ },
+
/**
* This function formats message for labels.
* @param String label i18n string ID.

Powered by Google App Engine
This is Rietveld 408576698