Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: ui/views/window/non_client_view.cc

Issue 99553008: Fix regression where the active window header was not used for apps on CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/non_client_view.cc
diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc
index fbdbce21ba7f7efa343857a7be3f3846fe1c71eb..57b6da324e88551b225b38ff97295f56b862f574 100644
--- a/ui/views/window/non_client_view.cc
+++ b/ui/views/window/non_client_view.cc
@@ -232,12 +232,23 @@ views::View* NonClientView::GetTooltipHandlerForPoint(const gfx::Point& point) {
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, public:
+NonClientFrameView::~NonClientFrameView() {
+}
+
void NonClientFrameView::SetInactiveRenderingDisabled(bool disable) {
- if (paint_as_active_ == disable)
+ if (inactive_rendering_disabled_ == disable)
return;
- paint_as_active_ = disable;
- ShouldPaintAsActiveChanged();
+ bool should_paint_as_active_old = ShouldPaintAsActive();
+ inactive_rendering_disabled_ = disable;
+
+ // The widget schedules a paint when the activation changes.
+ if (should_paint_as_active_old != ShouldPaintAsActive())
+ SchedulePaint();
+}
+
+bool NonClientFrameView::ShouldPaintAsActive() const {
+ return inactive_rendering_disabled_ || GetWidget()->IsActive();
}
int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point,
@@ -301,14 +312,6 @@ bool NonClientFrameView::HitTestRect(const gfx::Rect& rect) const {
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, protected:
-bool NonClientFrameView::ShouldPaintAsActive() const {
- return GetWidget()->IsActive() || paint_as_active_;
-}
-
-void NonClientFrameView::ShouldPaintAsActiveChanged() {
- SchedulePaint();
-}
-
void NonClientFrameView::GetAccessibleState(ui::AccessibleViewState* state) {
state->role = ui::AccessibilityTypes::ROLE_CLIENT;
}
@@ -322,4 +325,7 @@ void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
// FrameView when it is itself laid out, see comment in NonClientView::Layout.
}
+NonClientFrameView::NonClientFrameView() : inactive_rendering_disabled_(false) {
+}
+
} // namespace views
« no previous file with comments | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698