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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 10407110: Adds clipping to the tabs when stacked. This is necessary so we don't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 8 years, 7 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 | chrome/browser/ui/views/tabs/tab_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 2a2184e512a7fca49cbd6a07d6eb563fa52a5f22..7a4a7b719873c56f036ff28f14e419ae23415b28 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -302,6 +302,16 @@ void Tab::OnPaint(gfx::Canvas* canvas) {
if (width() < GetMinimumUnselectedSize().width() && !data().mini)
return;
+ gfx::Rect clip;
+ if (controller()) {
+ if (!controller()->ShouldPaintTab(this, &clip))
+ return;
+ if (!clip.IsEmpty()) {
+ canvas->Save();
+ canvas->ClipRect(clip);
+ }
+ }
+
// See if the model changes whether the icons should be painted.
const bool show_icon = ShouldShowIcon();
const bool show_close_button = ShouldShowCloseBox();
@@ -329,6 +339,9 @@ void Tab::OnPaint(gfx::Canvas* canvas) {
rb.GetImageSkiaNamed(IDR_TAB_CLOSE),
rb.GetImageSkiaNamed(IDR_TAB_CLOSE_MASK));
}
+
+ if (!clip.IsEmpty())
+ canvas->Restore();
}
void Tab::Layout() {
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698