Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: ui/views/widget/desktop_root_window_host_win.cc

Issue 11367041: Adds View::GetNativeTheme() to get the NativeTheme. The interesting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix include Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_root_window_host_linux.cc ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « ui/views/widget/desktop_root_window_host_linux.cc ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698