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

Issue 2016963002: DevTools: rework focus logic (Closed)

Created:
4 years, 7 months ago by luoe
Modified:
4 years, 6 months ago
Reviewers:
dgozman, lushnikov
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, sergeyv+blink_chromium.org, pfeldman, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: rework focus logic Summary of changes: - We actually have 3 places where GlassPanes are instantiated [Dialogs, Options in Toolbar, DraggingElements (e.g. Colorpicker)] - DefaultFocusedViewStack is not necessary and is removed. Previously, it was only used by Dialogs anyways. Dialogs are the only GlassPanes that will save the previously focused element and call .focus() when the dialog closes - Showing a different tab (switching to a drawer panel) will now focus on the new tab, if no previous focus was set - DeviceMode's toolbar previously depended on .setSelectionRange() to keep focus in its size input field while resizing. Now, dragging the splitter won't steal focus at all, so DeviceMode doesn't need to force focus on itself - When using the Command Menu to open a panel/file, it will close the GlassPane first (which may call .focus() on the previous element) before calling .show() on the new panel/file, so that the new panel/file gets the final focus BUG=604427, 609013, 612397 Committed: https://crrev.com/d436b82c55a2d1d5ad217b59afd2744e1aa6fa77 Cr-Commit-Position: refs/heads/master@{#396955}

Patch Set 1 #

Patch Set 2 : Move Dialog logic into Dialog; opening tabs will focus if no focus was set #

Total comments: 8

Patch Set 3 : Address patch 1 comments #

Patch Set 4 : Removed unnecessary focus call #

Patch Set 5 : Remove stray newline #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -19 lines) Patch
M third_party/WebKit/Source/devtools/front_end/ui/Dialog.js View 1 2 3 chunks +11 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/ui/Drawer.js View 1 2 1 chunk +12 lines, -1 line 2 comments Download
M third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/ui/ShortcutRegistry.js View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js View 1 3 chunks +0 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js View 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (8 generated)
luoe
Summary of changes: - We actually have 3 places where GlassPanes are instantiated [Dialogs, Options ...
4 years, 7 months ago (2016-05-27 00:48:29 UTC) #2
dgozman
https://codereview.chromium.org/2016963002/diff/20001/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js File third_party/WebKit/Source/devtools/front_end/ui/Dialog.js (right): https://codereview.chromium.org/2016963002/diff/20001/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js#newcode79 third_party/WebKit/Source/devtools/front_end/ui/Dialog.js:79: WebInspector.Dialog._previousFocusedElement = WebInspector.currentFocusElement() || WebInspector.inspectorView.defaultFocusedElement(); Use WebInspector.Dialog._modalHostView instead of ...
4 years, 7 months ago (2016-05-27 01:06:00 UTC) #5
lushnikov
overall, feels good! https://codereview.chromium.org/2016963002/diff/20001/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js File third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js (right): https://codereview.chromium.org/2016963002/diff/20001/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js#newcode325 third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js:325: var shouldFocus = this.hasFocus() || !WebInspector.currentFocusElement(); ...
4 years, 7 months ago (2016-05-27 01:14:44 UTC) #6
luoe
Please take a look at Drawer.js for the added logic in showView(). https://codereview.chromium.org/2016963002/diff/20001/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js File third_party/WebKit/Source/devtools/front_end/ui/Dialog.js ...
4 years, 6 months ago (2016-05-27 23:20:40 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2016963002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2016963002/80001
4 years, 6 months ago (2016-05-31 17:07:16 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-31 18:50:28 UTC) #11
dgozman
lgtm https://codereview.chromium.org/2016963002/diff/80001/third_party/WebKit/Source/devtools/front_end/ui/Drawer.js File third_party/WebKit/Source/devtools/front_end/ui/Drawer.js (right): https://codereview.chromium.org/2016963002/diff/80001/third_party/WebKit/Source/devtools/front_end/ui/Drawer.js#newcode78 third_party/WebKit/Source/devtools/front_end/ui/Drawer.js:78: this.focus(); I think you can call |this.focus()| right ...
4 years, 6 months ago (2016-05-31 19:30:42 UTC) #12
luoe
https://codereview.chromium.org/2016963002/diff/80001/third_party/WebKit/Source/devtools/front_end/ui/Drawer.js File third_party/WebKit/Source/devtools/front_end/ui/Drawer.js (right): https://codereview.chromium.org/2016963002/diff/80001/third_party/WebKit/Source/devtools/front_end/ui/Drawer.js#newcode78 third_party/WebKit/Source/devtools/front_end/ui/Drawer.js:78: this.focus(); On 2016/05/31 19:30:42, dgozman wrote: > I think ...
4 years, 6 months ago (2016-05-31 21:22:54 UTC) #13
luoe
Do you think we should add a comment, making it clear that after Drawer.focus(), it ...
4 years, 6 months ago (2016-05-31 21:24:14 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2016963002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2016963002/80001
4 years, 6 months ago (2016-05-31 22:29:35 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 6 months ago (2016-05-31 22:35:26 UTC) #18
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 22:36:50 UTC) #20
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d436b82c55a2d1d5ad217b59afd2744e1aa6fa77
Cr-Commit-Position: refs/heads/master@{#396955}

Powered by Google App Engine
This is Rietveld 408576698