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

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: . 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..4a6677f6cb427451df97d1e9dde27b8382bf3026 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,10 +183,22 @@ Polymer({
ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED,
Name: {Active: name},
};
+ this.didSetFocus_ = false;
this.getNetworkDetails_();
},
/** @private */
+ maybeSetFocus_: function() {
+ if (this.didSetFocus_)
+ return;
+ this.didSetFocus_ = true;
+ var button = this.$$('#buttonDiv .primary-button:not([hidden])');
+ if (!button)
+ button = this.$$('#buttonDiv .secondary-button:not([hidden])');
+ button.focus();
+ },
+
+ /** @private */
close_: function() {
// Delay navigating until the next render frame to allow other subpages to
// load first.
@@ -285,6 +300,7 @@ Polymer({
return;
}
this.networkProperties = properties;
+ this.maybeSetFocus_();
},
/**
@@ -305,6 +321,7 @@ Polymer({
Connectable: state.Connectable,
ConnectionState: state.ConnectionState,
};
+ this.maybeSetFocus_();
},
/**
@@ -549,7 +566,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