diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-31 07:39:29 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-31 07:39:29 +0000 |
commit | 86681b9dccc5d4ea00d5f767f0e9bf417c618cc9 (patch) | |
tree | c1eada026dcccecd2163ce62d1e1472bce267610 /views/widget | |
parent | 878ae96bea0bb797e2a47b7a685c56cb6b5601d0 (diff) | |
download | chromium_src-86681b9dccc5d4ea00d5f767f0e9bf417c618cc9.zip chromium_src-86681b9dccc5d4ea00d5f767f0e9bf417c618cc9.tar.gz chromium_src-86681b9dccc5d4ea00d5f767f0e9bf417c618cc9.tar.bz2 |
Use the right frame type on startup, do proper swapping of frames when themes change. Leave the native frame decision up to the ThemeProvider.
BUG=12890
TEST=In Aero, unstall a theme, reset to default, install again, restart, reset theme to default. Make sure that the Aero frame changes to the themed frame and back again appropriately.
Review URL: http://codereview.chromium.org/118053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/default_theme_provider.cc | 12 | ||||
-rw-r--r-- | views/widget/default_theme_provider.h | 1 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/views/widget/default_theme_provider.cc b/views/widget/default_theme_provider.cc index be348a9..d5b8e3d 100644 --- a/views/widget/default_theme_provider.cc +++ b/views/widget/default_theme_provider.cc @@ -6,6 +6,10 @@ #include "app/resource_bundle.h" +#if defined(OS_WIN) +#include "app/win_util.h" +#endif + namespace views { SkBitmap* DefaultThemeProvider::GetBitmapNamed(int id) { @@ -17,4 +21,12 @@ SkColor DefaultThemeProvider::GetColor(int id) { return 0xff0000ff; } +bool DefaultThemeProvider::ShouldUseNativeFrame() { +#if defined(OS_WIN) + return win_util::ShouldUseVistaFrame(); +#else + return false; +#endif +} + } // namespace views diff --git a/views/widget/default_theme_provider.h b/views/widget/default_theme_provider.h index 1060c8e..879034f 100644 --- a/views/widget/default_theme_provider.h +++ b/views/widget/default_theme_provider.h @@ -20,6 +20,7 @@ class DefaultThemeProvider : public ThemeProvider { // Overridden from ThemeProvider. virtual SkBitmap* GetBitmapNamed(int id); virtual SkColor GetColor(int id); + virtual bool ShouldUseNativeFrame(); private: DISALLOW_COPY_AND_ASSIGN(DefaultThemeProvider); diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 2d4d3ac..adce4d9 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -202,7 +202,7 @@ void WidgetWin::Init(HWND parent, const gfx::Rect& bounds, // Windows special DWM window frame requires a special tooltip manager so // that window controls in Chrome windows don't flicker when you move your // mouse over them. See comment in aero_tooltip_manager.h. - if (win_util::ShouldUseVistaFrame()) { + if (GetThemeProvider()->ShouldUseNativeFrame()) { tooltip_manager_.reset(new AeroTooltipManager(this)); } else { tooltip_manager_.reset(new TooltipManagerWin(this)); |