diff options
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/non_client_view.cc | 4 | ||||
-rw-r--r-- | views/window/non_client_view.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc index 29c48cc..d6d7b93 100644 --- a/views/window/non_client_view.cc +++ b/views/window/non_client_view.cc @@ -276,4 +276,8 @@ int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point, return can_resize ? component : HTBORDER; } +bool NonClientFrameView::ShouldPaintAsActive() const { + return GetWindow()->IsActive() || paint_as_active_; +} + } // namespace views diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h index 34992ec..902967d 100644 --- a/views/window/non_client_view.h +++ b/views/window/non_client_view.h @@ -31,6 +31,9 @@ class NonClientFrameView : public View { // frame border. static const int kClientEdgeThickness; + // Prevent the frame view from painting its inactive state. Prevents a related + // window from causing its owner to appear deactivated. Used for windows like + // bubbles. void DisableInactiveRendering(bool disable) { paint_as_active_ = disable; if (!paint_as_active_) @@ -81,8 +84,10 @@ class NonClientFrameView : public View { int resize_corner_width, bool can_resize); - // Accessor for paint_as_active_. - bool paint_as_active() const { return paint_as_active_; } + // Used to determine if the frame should be painted as active. Keyed off the + // window's actual active state and the override, see + // DisableInactiveRendering() above. + bool ShouldPaintAsActive() const; private: // True when the non-client view should always be rendered as if the window |