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

Unified Diff: ash/wm/frame_painter.cc

Issue 10816004: Fixes missing 5 pixel inset for theme background in Ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « ash/wm/frame_painter.h ('k') | chrome/browser/ui/panels/panel_browser_frame_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/frame_painter.cc
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc
index 553851d8ae57871d01cd1cb445f6ca15c6b10c53..80f8f4ea3ce031405f7a9afe0ffa59d92e764b13 100644
--- a/ash/wm/frame_painter.cc
+++ b/ash/wm/frame_painter.cc
@@ -76,7 +76,7 @@ const int kButtonOverlap = 1;
// we need to copy the theme image for the window header from a few pixels
// inset to preserve alignment with the NTP image, or else we'll break a bunch
// of existing themes. We do something similar on OS X for the same reason.
-const int kThemeFrameImageOffsetX = 5;
+const int kThemeFrameImageInsetX = 5;
// Duration of crossfade animation for activating and deactivating frame.
const int kActivationCrossfadeDurationMs = 200;
// Alpha/opacity value for fully-opaque headers.
@@ -89,7 +89,7 @@ void TileRoundRect(gfx::Canvas* canvas,
const SkPaint& paint,
const gfx::ImageSkia& image,
int corner_radius,
- int image_offset_x) {
+ int image_inset_x) {
// To get the shader to sample the image |inset_y| pixels in but tile across
// the whole image, we adjust the target rectangle for the shader to the right
// and translate the canvas left to compensate.
@@ -103,7 +103,7 @@ void TileRoundRect(gfx::Canvas* canvas,
0, 0}; // bottom-left
SkPath path;
path.addRoundRect(rect, radii, SkPath::kCW_Direction);
- canvas->DrawImageInPath(image, -image_offset_x, 0, path, paint);
+ canvas->DrawImageInPath(image, -image_inset_x, 0, path, paint);
}
// Returns true if |window| is a visible, normal window.
@@ -301,6 +301,10 @@ int FramePainter::GetRightInset() const {
kButtonOverlap;
}
+int FramePainter::GetThemeBackgroundXInset() const {
+ return kThemeFrameImageInsetX;
+}
+
void FramePainter::PaintHeader(views::NonClientFrameView* view,
gfx::Canvas* canvas,
HeaderMode header_mode,
@@ -341,7 +345,7 @@ void FramePainter::PaintHeader(views::NonClientFrameView* view,
paint,
*crossfade_theme_frame,
kCornerRadius,
- kThemeFrameImageOffsetX);
+ GetThemeBackgroundXInset());
paint.setAlpha(new_alpha);
} else {
@@ -358,7 +362,7 @@ void FramePainter::PaintHeader(views::NonClientFrameView* view,
paint,
*theme_frame,
kCornerRadius,
- kThemeFrameImageOffsetX);
+ GetThemeBackgroundXInset());
previous_theme_frame_id_ = theme_frame_id;
previous_opacity_ = opacity;
« no previous file with comments | « ash/wm/frame_painter.h ('k') | chrome/browser/ui/panels/panel_browser_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698