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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js

Issue 2016963002: DevTools: rework focus logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move Dialog logic into Dialog; opening tabs will focus if no focus was set Created 4 years, 7 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: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
index 9f3fb088f76a98154fdfa0670d73a033e37dde11..155672b178a906fd6c1c4089d12fd27c379c67b7 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
@@ -322,7 +322,7 @@ WebInspector.TabbedPane.prototype = {
{
if (this._currentTabLocked)
return false;
- var focused = this.hasFocus();
+ var shouldFocus = this.hasFocus() || !WebInspector.currentFocusElement();
dgozman 2016/05/27 01:05:59 This looks strange. The logic here was preserving
lushnikov 2016/05/27 01:14:44 maybe focusing iff userGesture would work as well
luoe 2016/05/27 23:20:40 Almost, but it didn't cover all the cases.
luoe 2016/05/27 23:20:40 Yeah, it is strange. The condition has been rever
var tab = this._tabsById[id];
if (!tab)
return false;
@@ -337,7 +337,7 @@ WebInspector.TabbedPane.prototype = {
this._tabsHistory.splice(0, 0, tab);
this._updateTabElements();
- if (focused)
+ if (shouldFocus)
this.focus();
var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture };

Powered by Google App Engine
This is Rietveld 408576698