diff options
Diffstat (limited to 'views')
-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); }; |