| Index: chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| diff --git a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| index 6aa0f15420afe4ddcac98105f51df8cd239ef27e..e89623beef41cc6eeb572a35bb7cdd0649748c49 100644
|
| --- a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| +++ b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.js
|
| @@ -34,6 +34,12 @@ Polymer({
|
| lastFocused_: Object,
|
| },
|
|
|
| + /**
|
| + * The element to return focus to, when the startup-url-dialog is closed.
|
| + * @private {?HTMLElement}
|
| + */
|
| + startupUrlDialogAnchor_: null,
|
| +
|
| /** @override */
|
| attached: function() {
|
| this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance();
|
| @@ -48,7 +54,8 @@ Polymer({
|
| this.browserProxy_.loadStartupPages();
|
|
|
| this.addEventListener(settings.EDIT_STARTUP_URL_EVENT, function(event) {
|
| - this.startupUrlDialogModel_ = event.detail;
|
| + this.startupUrlDialogModel_ = event.detail.model;
|
| + this.startupUrlDialogAnchor_ = event.detail.anchor;
|
| this.showStartupUrlDialog_ = true;
|
| event.stopPropagation();
|
| }.bind(this));
|
| @@ -61,12 +68,18 @@ Polymer({
|
| onAddPageTap_: function(e) {
|
| e.preventDefault();
|
| this.showStartupUrlDialog_ = true;
|
| + this.startupUrlDialogAnchor_ = /** @type {!HTMLElement} */ (
|
| + this.$$('#addPage a[is=action-link]'));
|
| },
|
|
|
| /** @private */
|
| destroyUrlDialog_: function() {
|
| this.showStartupUrlDialog_ = false;
|
| this.startupUrlDialogModel_ = null;
|
| + if (this.startupUrlDialogAnchor_) {
|
| + this.startupUrlDialogAnchor_.focus();
|
| + this.startupUrlDialogAnchor_ = null;
|
| + }
|
| },
|
|
|
| /** @private */
|
|
|