summaryrefslogtreecommitdiffstats
path: root/ash/frame/default_header_painter.cc
diff options
context:
space:
mode:
authorBen Wells <benwells@chromium.org>2015-08-06 14:23:26 +1000
committerBen Wells <benwells@chromium.org>2015-08-06 04:24:51 +0000
commit3e0f7f551a91b2e1af0714858f52cf5d86f026f5 (patch)
tree06eb596cc5592968aa8cacf6b43d6e43b361254c /ash/frame/default_header_painter.cc
parentacdf54994aff0f5f994d7f7113e9572d10e93d46 (diff)
downloadchromium_src-3e0f7f551a91b2e1af0714858f52cf5d86f026f5.zip
chromium_src-3e0f7f551a91b2e1af0714858f52cf5d86f026f5.tar.gz
chromium_src-3e0f7f551a91b2e1af0714858f52cf5d86f026f5.tar.bz2
Remove gap in ChromeOS hosted app frames which are showing the location.
For security reasons, hosted apps which have navigated away from their starting origin show the origin. On ChromeOS this caused a bug where a 2 pixel transparent gap was created between the frame and the location bar. This was because the for this type of frame, the toolbar was positioned to be calculated using the HeaderHeightForPainting. However the HeaderHeightForPainting was adjusted prior to the toolbar being positioned to account for the toolbar not painting the top two rows of pixels. The fix is to position the toolbar relative to the base height of the frame. TBR=sky@chromium.org BUG=508043 Review URL: https://codereview.chromium.org/1240733003 Cr-Commit-Position: refs/heads/master@{#339581} (cherry picked from commit cb03d6cb0f306228a7b7e3e4dfc1188d49b16556) Review URL: https://codereview.chromium.org/1272173003 . Cr-Commit-Position: refs/branch-heads/2454@{#243} Cr-Branched-From: 12bfc3360892ec53cd00fc239a47e5298beb063b-refs/heads/master@{#338390}
Diffstat (limited to 'ash/frame/default_header_painter.cc')
-rw-r--r--ash/frame/default_header_painter.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 72d720e..a80a3c6 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -82,11 +82,10 @@ DefaultHeaderPainter::DefaultHeaderPainter()
active_frame_color_(kDefaultFrameColor),
inactive_frame_color_(kDefaultFrameColor),
caption_button_container_(NULL),
- height_(0),
+ painted_height_(0),
mode_(MODE_INACTIVE),
initial_paint_(true),
- activation_animation_(new gfx::SlideAnimation(this)) {
-}
+ activation_animation_(new gfx::SlideAnimation(this)) {}
DefaultHeaderPainter::~DefaultHeaderPainter() {
}
@@ -172,12 +171,16 @@ void DefaultHeaderPainter::LayoutHeader() {
SetHeaderHeightForPainting(caption_button_container_->height());
}
+int DefaultHeaderPainter::GetHeaderHeight() const {
+ return caption_button_container_->height();
+}
+
int DefaultHeaderPainter::GetHeaderHeightForPainting() const {
- return height_;
+ return painted_height_;
}
void DefaultHeaderPainter::SetHeaderHeightForPainting(int height) {
- height_ = height;
+ painted_height_ = height;
}
void DefaultHeaderPainter::SchedulePaintForTitle() {
@@ -269,7 +272,7 @@ void DefaultHeaderPainter::PaintHeaderContentSeparator(gfx::Canvas* canvas) {
paint.setStrokeWidth(0);
float thickness = 1 / canvas->image_scale();
- SkScalar y = SkIntToScalar(height_) - SkFloatToScalar(thickness);
+ SkScalar y = SkIntToScalar(painted_height_) - SkFloatToScalar(thickness);
canvas->sk_canvas()->drawLine(0, y, SkIntToScalar(view_->width()), y, paint);
}
@@ -342,7 +345,7 @@ void DefaultHeaderPainter::UpdateSizeButtonImages(bool use_light_images) {
}
gfx::Rect DefaultHeaderPainter::GetLocalBounds() const {
- return gfx::Rect(view_->width(), height_);
+ return gfx::Rect(view_->width(), painted_height_);
}
gfx::Rect DefaultHeaderPainter::GetTitleBounds() const {