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 |