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

Unified Diff: chrome/browser/resources/settings/internet_page/internet_detail_page.js

Issue 2841873004: MD Settings: Fix subpage navigation focus for bluetooth+internet (Closed)
Patch Set: Fix browser tests Created 3 years, 8 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/settings/internet_page/internet_detail_page.js
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index ef74fd58e9a3f81d343047e79d349016b95633d8..cd6ed56bbf9848e41ed1311b83f62905bf7d45b0 100644
--- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -144,6 +144,9 @@ Polymer({
*/
networksChangedListener_: null,
+ /** @private {boolean} */
+ didSetFocus_: false,
+
/**
* settings.RouteObserverBehavior
* @param {!settings.Route} route
@@ -180,6 +183,7 @@ Polymer({
ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED,
Name: {Active: name},
};
+ this.didSetFocus_ = false;
this.getNetworkDetails_();
},
@@ -216,6 +220,16 @@ Polymer({
// Update the detail page title.
this.parentNode.pageTitle = CrOnc.getNetworkName(this.networkProperties);
+
+ // Focus a button once the initial state is set.
+ if (!this.didSetFocus_) {
+ this.didSetFocus_ = true;
+ var button = this.$$('#buttonDiv .primary-button:not([hidden])');
+ if (!button)
+ button = this.$$('#buttonDiv .secondary-button:not([hidden])');
+ assert(button); // At least one button will always be visible.
+ button.focus();
+ }
},
/** @private */
@@ -549,7 +563,8 @@ Polymer({
this.networkingPrivate.startActivate(this.guid);
},
- /** @const {string} */ CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON',
+ /** @const {string} */
+ CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON',
/**
* @param {Event} event

Powered by Google App Engine
This is Rietveld 408576698