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

Unified Diff: ash/wm/custom_frame_view_ash.cc

Issue 11087065: Clip the header of ash windows to the frame height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years 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 | no next file » | 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 bb3c15222ff1683d3daa2c29ed696755c44a1879..6163324091fb11f977d13faeff4996b334e9cebf 100644
--- a/ash/wm/custom_frame_view_ash.cc
+++ b/ash/wm/custom_frame_view_ash.cc
@@ -11,6 +11,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/layer_animator.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/rect.h"
@@ -128,6 +129,11 @@ void CustomFrameViewAsh::OnPaint(gfx::Canvas* canvas) {
if (frame_->IsFullscreen())
return;
+ // Prevent bleeding paint onto the client area below the window frame, which
+ // may become visible when the WebContent is transparent.
+ canvas->Save();
+ canvas->ClipRect(gfx::Rect(0, 0, width(), NonClientTopBorderHeight()));
+
bool paint_as_active = ShouldPaintAsActive();
int theme_image_id = paint_as_active ? IDR_AURA_WINDOW_HEADER_BASE_ACTIVE :
IDR_AURA_WINDOW_HEADER_BASE_INACTIVE;
@@ -139,6 +145,7 @@ void CustomFrameViewAsh::OnPaint(gfx::Canvas* canvas) {
NULL);
frame_painter_->PaintTitleBar(this, canvas, GetTitleFont());
frame_painter_->PaintHeaderContentSeparator(this, canvas);
+ canvas->Restore();
}
std::string CustomFrameViewAsh::GetClassName() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698