diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-09 01:07:42 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-09 01:07:42 +0000 |
commit | 4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f (patch) | |
tree | 69a1e9f78b3a5fa8b909cfab336826b09c44235f /views/widget/widget_win.cc | |
parent | 5085ee0b4bfbe4625e63ee6975bb95702e13e0aa (diff) | |
download | chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.zip chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.gz chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.bz2 |
This is the first pass at themes.
This CL is paired with http://codereview.chromium.org/67284
This CL (for commit purposes) includes http://codereview.chromium.org/67284
BUG=4463,11232,11233,11234,11235
Review URL: http://codereview.chromium.org/99030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget_win.cc')
-rw-r--r-- | views/widget/widget_win.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index c59f512..25f25da 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -15,6 +15,7 @@ #include "views/fill_layout.h" #include "views/focus/focus_util_win.h" #include "views/widget/aero_tooltip_manager.h" +#include "views/widget/default_theme_provider.h" #include "views/widget/root_view.h" #include "views/window/window_win.h" @@ -166,6 +167,8 @@ void WidgetWin::Init(HWND parent, const gfx::Rect& bounds, // Force creation of the RootView if it hasn't been created yet. GetRootView(); + default_theme_provider_.reset(new DefaultThemeProvider()); + // Ensures the parent we have been passed is valid, otherwise CreateWindowEx // will fail. if (parent && !::IsWindow(parent)) { @@ -293,6 +296,11 @@ RootView* WidgetWin::GetRootView() { return root_view_.get(); } +Widget* WidgetWin::GetRootWidget() const { + return reinterpret_cast<WidgetWin*>( + win_util::GetWindowUserData(GetAncestor(hwnd_, GA_ROOT))); +} + bool WidgetWin::IsVisible() const { return !!::IsWindowVisible(GetNativeView()); } @@ -305,6 +313,16 @@ TooltipManager* WidgetWin::GetTooltipManager() { return tooltip_manager_.get(); } +ThemeProvider* WidgetWin::GetThemeProvider() const { + Widget* widget = GetRootWidget(); + if (widget) { + ThemeProvider* provider = widget->GetDialogThemeProvider(); + if (provider) + return provider; + } + return default_theme_provider_.get(); +} + Window* WidgetWin::GetWindow() { return GetWindowImpl(hwnd_); } |