Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc |
| index b42c5588f690932ca73ff3b5cbcfebe98703c4da..c79c450e39431d6d22b7a189360ecb9f9f2178f6 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc |
| @@ -96,8 +96,14 @@ DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { |
| // static |
| aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { |
| + // All HWND's we create should have WindowTreeHost instances associated with |
|
sky
2016/01/13 16:31:13
Is this change related?
ananta
2016/01/13 21:34:47
All HWND's created by views have WindowTreeHost in
|
| + // them. There are exceptions like the content layer creating HWND's which |
| + // are not associated with WindowTreeHost instances. In such cases we should |
| + // try and find the WindowTreeHost associated with the parent. |
| aura::WindowTreeHost* host = |
| aura::WindowTreeHost::GetForAcceleratedWidget(hwnd); |
| + if (!host) |
| + host = aura::WindowTreeHost::GetForAcceleratedWidget(::GetParent(hwnd)); |
| return host ? host->window()->GetProperty(kContentWindowForRootWindow) : NULL; |
| } |