Index: ui/views/widget/desktop_root_window_host_win.cc |
diff --git a/ui/views/widget/desktop_root_window_host_win.cc b/ui/views/widget/desktop_root_window_host_win.cc |
index c5b14f97a39b8f10f8129c922dbc721eca2f3632..8cb9bf30429391baf15223b1504e3740a0f0e6e3 100644 |
--- a/ui/views/widget/desktop_root_window_host_win.cc |
+++ b/ui/views/widget/desktop_root_window_host_win.cc |
@@ -16,6 +16,8 @@ |
#include "ui/aura/shared/input_method_event_filter.h" |
#include "ui/aura/window_property.h" |
#include "ui/base/cursor/cursor_loader_win.h" |
+#include "ui/base/native_theme/native_theme_aura.h" |
+#include "ui/base/native_theme/native_theme_win.h" |
#include "ui/base/win/shell.h" |
#include "ui/gfx/native_widget_types.h" |
#include "ui/gfx/path_win.h" |
@@ -31,8 +33,7 @@ |
namespace views { |
-DEFINE_WINDOW_PROPERTY_KEY( |
- aura::Window*, kContentWindowForRootWindow, NULL); |
+DEFINE_WINDOW_PROPERTY_KEY(aura::Window*, kContentWindowForRootWindow, NULL); |
//////////////////////////////////////////////////////////////////////////////// |
// DesktopRootWindowHostWin, public: |
@@ -58,6 +59,21 @@ aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) { |
return root ? root->GetProperty(kContentWindowForRootWindow) : NULL; |
} |
+// static |
+ui::NativeTheme* DesktopRootWindowHost::GetNativeTheme(aura::Window* window) { |
+ // Use NativeThemeWin for windows shown on the desktop, those not on the |
+ // desktop come from Ash and get NativeThemeAura. |
+ aura::RootWindow* root = window->GetRootWindow(); |
+ if (root) { |
+ HWND root_hwnd = root->GetAcceleratedWidget(); |
+ if (root_hwnd && |
+ DesktopRootWindowHostWin::GetContentWindowForHWND(root_hwnd)) { |
+ return ui::NativeThemeWin::instance(); |
+ } |
+ } |
+ return ui::NativeThemeAura::instance(); |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// DesktopRootWindowHostWin, DesktopRootWindowHost implementation: |