Index: ui/views/view.cc |
diff --git a/ui/views/view.cc b/ui/views/view.cc |
index 0fc755972d6d57de055a7ea9d31fa11733eaf13b..338afdc8d7ca460cafd3d720d9a2fada9b72adf6 100644 |
--- a/ui/views/view.cc |
+++ b/ui/views/view.cc |
@@ -53,6 +53,7 @@ |
#if defined(OS_WIN) |
#include "base/win/scoped_gdi_object.h" |
+#include "ui/native_theme/native_theme_win.h" |
#endif |
namespace views { |
@@ -830,12 +831,20 @@ void View::SetBorder(scoped_ptr<Border> b) { border_ = b.Pass(); } |
ui::ThemeProvider* View::GetThemeProvider() const { |
const Widget* widget = GetWidget(); |
- return widget ? widget->GetThemeProvider() : NULL; |
+ return widget ? widget->GetThemeProvider() : nullptr; |
} |
const ui::NativeTheme* View::GetNativeTheme() const { |
+// On Windows, ui::NativeTheme::GetInstanceForWeb() returns NativeThemeWinAura |
+// because that's what the renderer wants, but Views should default to |
+// NativeThemeWin. TODO(estade): clean this up, see http://crbug.com/558029 |
+#if defined(OS_WIN) |
+ const ui::NativeTheme* default_theme = ui::NativeThemeWin::instance(); |
+#else |
+ const ui::NativeTheme* default_theme = ui::NativeTheme::GetInstanceForWeb(); |
+#endif |
const Widget* widget = GetWidget(); |
- return widget ? widget->GetNativeTheme() : ui::NativeTheme::instance(); |
+ return widget ? widget->GetNativeTheme() : default_theme; |
} |
// RTL painting ---------------------------------------------------------------- |