diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:19:53 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:19:53 +0000 |
commit | d7ef11bbc6ea0545ab00e29fe006a2e1de29dde9 (patch) | |
tree | c4e96e45ee51017d02cc5705191ebe0e01659e7c /views/window | |
parent | d766882c913b272cc2db478d7640a317d838ebad (diff) | |
download | chromium_src-d7ef11bbc6ea0545ab00e29fe006a2e1de29dde9.zip chromium_src-d7ef11bbc6ea0545ab00e29fe006a2e1de29dde9.tar.gz chromium_src-d7ef11bbc6ea0545ab00e29fe006a2e1de29dde9.tar.bz2 |
Change the way the NonClientView handles forcing the native frame for popups/app windows.
Rather than carrying state in a force_native_frame_ member it uses a virtual method AlwaysUseNativeFrame analogous to AlwaysUseCustomFrame. This makes me a little happier.
BUG=none
TEST=On a vista capable system, test that when a theme is installed, popups and app frames are rendered with the native frame. Test that constrained windows (e.g. HTTP basic auth) are rendered with the custom frame. Without a theme installed, test that all windows have a native frame except constrained windows. With Vista Basic system setting, verify that all windows have a custom frame, including constrained windows.
Review URL: http://codereview.chromium.org/200146
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/non_client_view.cc | 23 | ||||
-rw-r--r-- | views/window/non_client_view.h | 13 |
2 files changed, 17 insertions, 19 deletions
diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc index a97531f..29c48cc 100644 --- a/views/window/non_client_view.cc +++ b/views/window/non_client_view.cc @@ -32,8 +32,7 @@ static const int kClientViewIndex = 1; NonClientView::NonClientView(Window* frame) : frame_(frame), - client_view_(NULL), - force_aero_glass_frame_(false) { + client_view_(NULL) { } NonClientView::~NonClientView() { @@ -69,11 +68,17 @@ void NonClientView::UpdateFrame() { } bool NonClientView::UseNativeFrame() const { - if (force_aero_glass_frame_) - return true; - // The frame view may always require a custom frame, e.g. Constrained Windows. - if (frame_view_.get() && frame_view_->AlwaysUseCustomFrame()) - return false; + if (frame_view_.get()) { + // The frame view may always require a native frame, e.g. popups on Vista+ + // when themes are active. + if (frame_view_->AlwaysUseNativeFrame()) + return true; + + // The frame view may always require a custom frame, e.g. Constrained + // Windows. + if (frame_view_->AlwaysUseCustomFrame()) + return false; + } return frame_->ShouldUseNativeFrame(); } @@ -204,10 +209,6 @@ void NonClientView::SetAccessibleName(const std::wstring& name) { accessible_name_ = name; } -void NonClientView::ForceAeroGlassFrame() { - force_aero_glass_frame_ = true; -} - //////////////////////////////////////////////////////////////////////////////// // NonClientFrameView, View overrides: diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h index c4ae4b0..6ed0dcf 100644 --- a/views/window/non_client_view.h +++ b/views/window/non_client_view.h @@ -46,6 +46,11 @@ class NonClientFrameView : public View { // which is a child window and must always provide its own frame. virtual bool AlwaysUseCustomFrame() const { return false; } + // Like AlwaysUseCustomFrame, returns true if this FrameView should always use + // the native frame, regardless of theme settings. An example is popup/app + // windows, which we do not ever want to show themed. + virtual bool AlwaysUseNativeFrame() const { return false; } + virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const = 0; virtual gfx::Point GetSystemMenuPoint() const = 0; @@ -198,10 +203,6 @@ class NonClientView : public View { virtual bool GetAccessibleName(std::wstring* name); virtual void SetAccessibleName(const std::wstring& name); - // Call if the nonclientview is in an app or popup and we are in Vista, to - // force usage of glass frame. - void ForceAeroGlassFrame(); - protected: // NonClientView, View overrides: virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); @@ -224,10 +225,6 @@ class NonClientView : public View { // The accessible name of this view. std::wstring accessible_name_; - // True if the nonclientview is in an app or popup and we are in Vista. Used - // to force usage of glass frame. - bool force_aero_glass_frame_; - DISALLOW_COPY_AND_ASSIGN(NonClientView); }; |