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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // All HWND's we create should have WindowTreeHost instances associated with | 100 // All HWND's we create should have WindowTreeHost instances associated with |
101 // them. There are exceptions like the content layer creating HWND's which | 101 // them. There are exceptions like the content layer creating HWND's which |
102 // are not associated with WindowTreeHost instances. | 102 // are not associated with WindowTreeHost instances. |
103 aura::WindowTreeHost* host = | 103 aura::WindowTreeHost* host = |
104 aura::WindowTreeHost::GetForAcceleratedWidget(hwnd); | 104 aura::WindowTreeHost::GetForAcceleratedWidget(hwnd); |
105 return host ? host->window()->GetProperty(kContentWindowForRootWindow) : NULL; | 105 return host ? host->window()->GetProperty(kContentWindowForRootWindow) : NULL; |
106 } | 106 } |
107 | 107 |
108 // static | 108 // static |
109 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { | 109 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { |
110 // Use NativeThemeWin for windows shown on the desktop, those not on the | 110 return ui::NativeTheme::GetInstanceForNativeUi(); |
111 // desktop come from Ash and get NativeThemeAura. | |
112 aura::WindowTreeHost* host = window ? window->GetHost() : NULL; | |
113 if (host) { | |
114 HWND host_hwnd = host->GetAcceleratedWidget(); | |
115 if (host_hwnd && | |
116 DesktopWindowTreeHostWin::GetContentWindowForHWND(host_hwnd)) { | |
117 return ui::NativeThemeWin::instance(); | |
118 } | |
119 } | |
120 return ui::NativeThemeAura::instance(); | |
121 } | 111 } |
122 | 112 |
123 //////////////////////////////////////////////////////////////////////////////// | 113 //////////////////////////////////////////////////////////////////////////////// |
124 // DesktopWindowTreeHostWin, DesktopWindowTreeHost implementation: | 114 // DesktopWindowTreeHostWin, DesktopWindowTreeHost implementation: |
125 | 115 |
126 void DesktopWindowTreeHostWin::Init(aura::Window* content_window, | 116 void DesktopWindowTreeHostWin::Init(aura::Window* content_window, |
127 const Widget::InitParams& params) { | 117 const Widget::InitParams& params) { |
128 // TODO(beng): SetInitParams(). | 118 // TODO(beng): SetInitParams(). |
129 content_window_ = content_window; | 119 content_window_ = content_window; |
130 wants_mouse_events_when_inactive_ = params.wants_mouse_events_when_inactive; | 120 wants_mouse_events_when_inactive_ = params.wants_mouse_events_when_inactive; |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 980 |
991 // static | 981 // static |
992 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 982 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
993 internal::NativeWidgetDelegate* native_widget_delegate, | 983 internal::NativeWidgetDelegate* native_widget_delegate, |
994 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 984 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
995 return new DesktopWindowTreeHostWin(native_widget_delegate, | 985 return new DesktopWindowTreeHostWin(native_widget_delegate, |
996 desktop_native_widget_aura); | 986 desktop_native_widget_aura); |
997 } | 987 } |
998 | 988 |
999 } // namespace views | 989 } // namespace views |
OLD | NEW |