Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 } | 89 } |
| 90 | 90 |
| 91 DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { | 91 DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { |
| 92 // WARNING: |content_window_| has been destroyed by the time we get here. | 92 // WARNING: |content_window_| has been destroyed by the time we get here. |
| 93 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); | 93 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); |
| 94 DestroyDispatcher(); | 94 DestroyDispatcher(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // static | 97 // static |
| 98 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { | 98 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { |
| 99 // All HWND's we create should have WindowTreeHost instances associated with | |
|
sky
2016/01/13 21:56:08
remove comment (at least last sentence, first two
ananta
2016/01/13 22:16:32
Done.
| |
| 100 // them. There are exceptions like the content layer creating HWND's which | |
| 101 // are not associated with WindowTreeHost instances. In such cases we should | |
| 102 // try and find the WindowTreeHost associated with the parent. | |
| 99 aura::WindowTreeHost* host = | 103 aura::WindowTreeHost* host = |
| 100 aura::WindowTreeHost::GetForAcceleratedWidget(hwnd); | 104 aura::WindowTreeHost::GetForAcceleratedWidget(hwnd); |
| 101 return host ? host->window()->GetProperty(kContentWindowForRootWindow) : NULL; | 105 return host ? host->window()->GetProperty(kContentWindowForRootWindow) : NULL; |
| 102 } | 106 } |
| 103 | 107 |
| 104 // static | 108 // static |
| 105 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { | 109 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { |
| 106 // Use NativeThemeWin for windows shown on the desktop, those not on the | 110 // Use NativeThemeWin for windows shown on the desktop, those not on the |
| 107 // desktop come from Ash and get NativeThemeAura. | 111 // desktop come from Ash and get NativeThemeAura. |
| 108 aura::WindowTreeHost* host = window ? window->GetHost() : NULL; | 112 aura::WindowTreeHost* host = window ? window->GetHost() : NULL; |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 | 962 |
| 959 // static | 963 // static |
| 960 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 964 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 961 internal::NativeWidgetDelegate* native_widget_delegate, | 965 internal::NativeWidgetDelegate* native_widget_delegate, |
| 962 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 966 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 963 return new DesktopWindowTreeHostWin(native_widget_delegate, | 967 return new DesktopWindowTreeHostWin(native_widget_delegate, |
| 964 desktop_native_widget_aura); | 968 desktop_native_widget_aura); |
| 965 } | 969 } |
| 966 | 970 |
| 967 } // namespace views | 971 } // namespace views |
| OLD | NEW |