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

Unified Diff: ash/wm/custom_frame_view_ash.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 | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/custom_frame_view_ash.cc
diff --git a/ash/wm/custom_frame_view_ash.cc b/ash/wm/custom_frame_view_ash.cc
index dd594b3c6c7972e46b635fb7bf57cd39ebfbc1bc..961ba6c8e37627b0570408a11f7a6703c839b626 100644
--- a/ash/wm/custom_frame_view_ash.cc
+++ b/ash/wm/custom_frame_view_ash.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size.h"
#include "ui/views/view.h"
#include "ui/views/widget/native_widget_aura.h"
@@ -160,11 +161,6 @@ class CustomFrameViewAsh::HeaderView
virtual void Layout() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- // Sets whether the header should be painted as active.
- void set_paint_as_active(bool paint_as_active) {
- paint_as_active_ = paint_as_active;
- }
-
HeaderPainter* header_painter() {
return header_painter_.get();
}
@@ -196,9 +192,6 @@ class CustomFrameViewAsh::HeaderView
// Keeps track of whether |maximize_bubble_| is still alive.
scoped_ptr<views::WidgetDeletionObserver> maximize_bubble_lifetime_observer_;
- // Whether the header should be painted as active.
- bool paint_as_active_;
-
// The fraction of the header's height which is visible while in fullscreen.
// This value is meaningless when not in fullscreen.
double fullscreen_visible_fraction_;
@@ -211,7 +204,6 @@ CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame)
header_painter_(new ash::HeaderPainter),
caption_button_container_(NULL),
maximize_bubble_(NULL),
- paint_as_active_(false),
fullscreen_visible_fraction_(0) {
// Unfortunately, there is no views::WidgetDelegate::CanMinimize(). Assume
// that the window frame can be minimized if it can be maximized.
@@ -272,7 +264,7 @@ void CustomFrameViewAsh::HeaderView::OnPaint(gfx::Canvas* canvas) {
int theme_image_id = 0;
if (frame_->IsMaximized() || frame_->IsFullscreen())
theme_image_id = IDR_AURA_WINDOW_HEADER_BASE_MINIMAL;
- else if (paint_as_active_)
+ else if (frame_->non_client_view()->frame_view()->ShouldPaintAsActive())
theme_image_id = IDR_AURA_WINDOW_HEADER_BASE_ACTIVE;
else
theme_image_id = IDR_AURA_WINDOW_HEADER_BASE_INACTIVE;
@@ -477,8 +469,9 @@ gfx::Size CustomFrameViewAsh::GetMaximumSize() {
void CustomFrameViewAsh::SchedulePaintInRect(const gfx::Rect& r) {
// The HeaderView is not a child of CustomFrameViewAsh. Redirect the paint to
// HeaderView instead.
- header_view_->set_paint_as_active(ShouldPaintAsActive());
- header_view_->SchedulePaint();
+ gfx::RectF to_paint(r);
+ views::View::ConvertRectToTarget(this, header_view_, &to_paint);
+ header_view_->SchedulePaintInRect(gfx::ToEnclosingRect(to_paint));
}
bool CustomFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698