| Index: third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| index 7b8c44354ecaf8597dc80fb42d92d823c4ac98e9..5499b122a90d35a70555c884b0f3275661206458 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| @@ -74,14 +74,10 @@ WebInspector.Dialog.prototype = {
|
| this._glassPane.element.addEventListener("click", this._onGlassPaneClick.bind(this), false);
|
| this.element.ownerDocument.body.addEventListener("keydown", this._keyDownBound, false);
|
|
|
| - // When a dialog closes, focus should be restored to the previous focused element when
|
| - // possible, otherwise the default inspector view element.
|
| - WebInspector.Dialog._previousFocusedElement = WebInspector.currentFocusElement();
|
| -
|
| WebInspector.Widget.prototype.show.call(this, this._glassPane.element);
|
|
|
| this._position();
|
| - this.focus();
|
| + this._focusRestorer = new WebInspector.WidgetFocusRestorer(this);
|
| },
|
|
|
| /**
|
| @@ -89,16 +85,14 @@ WebInspector.Dialog.prototype = {
|
| */
|
| detach: function()
|
| {
|
| + this._focusRestorer.restore();
|
| +
|
| this.element.ownerDocument.body.removeEventListener("keydown", this._keyDownBound, false);
|
| WebInspector.Widget.prototype.detach.call(this);
|
|
|
| this._glassPane.dispose();
|
| delete this._glassPane;
|
|
|
| - if (WebInspector.Dialog._previousFocusedElement)
|
| - WebInspector.Dialog._previousFocusedElement.focus();
|
| - delete WebInspector.Dialog._previousFocusedElement;
|
| -
|
| this._restoreTabIndexOnElements();
|
|
|
| delete WebInspector.Dialog._instance;
|
|
|