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

Unified Diff: chrome/browser/ui/cocoa/download/download_show_all_button.mm

Issue 1125363005: Fix darkly-drawn Show All button in Downloads Shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change API to accommodate Show All button background drawing. Created 5 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 | ui/base/cocoa/nsview_additions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/download/download_show_all_button.mm
diff --git a/chrome/browser/ui/cocoa/download/download_show_all_button.mm b/chrome/browser/ui/cocoa/download/download_show_all_button.mm
index 6a915433865bcc19b141c6fc23acfb0d18decdb5..df7ab45baa4aa732817fb2ff2b7b9e737cb4ba56 100644
--- a/chrome/browser/ui/cocoa/download/download_show_all_button.mm
+++ b/chrome/browser/ui/cocoa/download/download_show_all_button.mm
@@ -44,7 +44,18 @@
- (void)drawRect:(NSRect)rect {
NSView* downloadShelfView = [self ancestorWithViewID:VIEW_ID_DOWNLOAD_SHELF];
- [self cr_drawUsingAncestor:downloadShelfView inRect:rect];
+ // Previously the show all button used cr_drawUsingAncestor:inRect: to use
+ // the download shelf to draw its background. However when the download
+ // shelf has zero height, the shelf's drawing methods don't work as expected
+ // because they constrain their drawing to the shelf's bounds rect. This
+ // situation occurs sometimes when the shelf is about to become visible,
+ // and the result is a very dark show all button
+ //
+ // To work around this problem, we'll call a variant of that method which
+ // does restrict drawing to the ancestor view's bounds.
+ [self cr_drawUsingAncestor:downloadShelfView
+ inRect:rect
+ clippedToAncestorBounds:NO];
[super drawRect:rect];
}
« no previous file with comments | « no previous file | ui/base/cocoa/nsview_additions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698