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

Issue 2645253002: DesktopAura: Track windows "owned" via the DesktopWindowTreeHost (Closed)

Created:
3 years, 11 months ago by tapted
Modified:
3 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DesktopAura: Track windows "owned" via the DesktopWindowTreeHost Widget::GetAllOwnedWidgets() is currently populated from Aura child windows (in the same WindowTreeHost), and "transient" child windows added using wm::AddTransientChild(). However, only NativeWidgetAura uses wm::AddTransientChild(). This means that a parented Widget using a DesktopNativeWidgetAura (e.g. for a top-level Widget on Windows Aero), rather than a NativeWidgetAura, will not be reported in its parent window's "GetAllOwnedWidgets()". Ownership of these top-level Widgets is managed in mus-, win-, or x11-specific code. To fix, add a method to DesktopWindowTreeHost that allows an implementation to provide a vector<DesktopWindowTreeHost*> of windows it owns. Widgets are usually associated with the aura::Window that is a grandchild of the aura::Window associated with the WindowTreeHost - this is done by DesktopNativeWidgetAura, so a method for NativeWidgetPrivate to obtain Widgets is also added. BUG=683808, 654151

Patch Set 1 : Fix win, mus probably #

Patch Set 2 : fix wmstate goo #

Patch Set 3 : Clean up view_event_test_platform_part #

Patch Set 4 : simpler #

Total comments: 3

Patch Set 5 : Query the WindowTreeHost, update test for grandchildren #

Patch Set 6 : Add a flag - this should change nothing - why you fail Mr Test :| #

Patch Set 7 : Rejig so we can use kDesktopNativeWidgetAuraKey #

Total comments: 9

Patch Set 8 : Add context, comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -18 lines) Patch
M chrome/browser/ui/test/test_browser_dialog.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/accessibility/native_view_accessibility.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/views/mus/desktop_window_tree_host_mus.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/mus/desktop_window_tree_host_mus.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.cc View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_win.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 2 3 4 5 6 3 chunks +26 lines, -6 lines 0 comments Download
M ui/views/widget/native_widget_mac.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 2 3 4 5 6 2 chunks +10 lines, -1 line 0 comments Download
M ui/views/widget/native_widget_private.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -1 line 0 comments Download
M ui/views/widget/widget.h View 1 2 3 4 5 1 chunk +6 lines, -3 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 2 3 4 5 6 2 chunks +56 lines, -1 line 0 comments Download
M ui/views/win/hwnd_message_handler.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 4 2 chunks +17 lines, -1 line 0 comments Download

Messages

Total messages: 72 (66 generated)
tapted
Hi sky - this is not ready to land yet (there's a test failure - ...
3 years, 11 months ago (2017-01-23 10:52:55 UTC) #31
sky
I worry that adding transients at the aura level is going to cause all sorts ...
3 years, 11 months ago (2017-01-23 16:56:42 UTC) #34
tapted
Hi sky, PTAL. Turned out to be rather tricky... maybe you see a simpler approach ...
3 years, 11 months ago (2017-01-25 11:23:03 UTC) #64
sky
Sadly I can't think of an easier approach. https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility/native_view_accessibility.cc File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility/native_view_accessibility.cc#newcode258 ui/views/accessibility/native_view_accessibility.cc:258: Widget::GetAllOwnedWidgets(widget->GetNativeView(), ...
3 years, 11 months ago (2017-01-25 16:41:24 UTC) #65
tapted
https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility/native_view_accessibility.cc File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility/native_view_accessibility.cc#newcode258 ui/views/accessibility/native_view_accessibility.cc:258: Widget::GetAllOwnedWidgets(widget->GetNativeView(), &child_widgets, false); On 2017/01/25 16:41:24, sky wrote: > ...
3 years, 10 months ago (2017-01-27 05:34:56 UTC) #71
tapted
3 years, 10 months ago (2017-01-30 10:33:04 UTC) #72
https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility...
File ui/views/accessibility/native_view_accessibility.cc (right):

https://codereview.chromium.org/2645253002/diff/260001/ui/views/accessibility...
ui/views/accessibility/native_view_accessibility.cc:258:
Widget::GetAllOwnedWidgets(widget->GetNativeView(), &child_widgets, false);
On 2017/01/27 05:34:55, tapted wrote:
> An alternative may be to add some Win- and X11- specific code to
> test_browser_dialog.cc that scans through OS window handles and checks for new
> Widgets that appear there. 

/* snip */

In case this pops in your queue first, I've explored this alternative at
https://codereview.chromium.org/2660813002/

Powered by Google App Engine
This is Rietveld 408576698