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 da888ecdc66b912b8a7f34afbcd19ba28b863a83..40ab10607c1f2e007a7f8ad2fba3d8de3867cf92 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. |
*/ |
@@ -21,22 +22,49 @@ Polymer({ |
}, |
}, |
+ /** |
+ * 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'); |
}, |
+ 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. |