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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_shelf_view.mm

Issue 250703003: CoreAnimation: Fix download shelf pattern phase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/download/download_shelf_view.h" 5 #import "chrome/browser/ui/cocoa/download/download_shelf_view.h"
6 6
7 #include "chrome/browser/themes/theme_properties.h" 7 #include "chrome/browser/themes/theme_properties.h"
8 #include "chrome/browser/themes/theme_service.h" 8 #include "chrome/browser/themes/theme_service.h"
9 #import "chrome/browser/ui/cocoa/nsview_additions.h" 9 #import "chrome/browser/ui/cocoa/nsview_additions.h"
10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 - (void)drawRect:(NSRect)rect { 44 - (void)drawRect:(NSRect)rect {
45 gfx::ScopedNSGraphicsContextSaveGState saveGState; 45 gfx::ScopedNSGraphicsContextSaveGState saveGState;
46 46
47 // We want our backgrounds for the shelf to be phased from the upper 47 // We want our backgrounds for the shelf to be phased from the upper
48 // left hand corner of the view. Offset it by tab height so that the 48 // left hand corner of the view. Offset it by tab height so that the
49 // background matches the toolbar background. 49 // background matches the toolbar background.
50 NSPoint phase = NSMakePoint( 50 NSPoint phase = NSMakePoint(
51 0, NSHeight([self bounds]) + [TabStripController defaultTabHeight]); 51 0, NSHeight([self bounds]) + [TabStripController defaultTabHeight]);
52 [[NSGraphicsContext currentContext] cr_setPatternPhase:phase forView:self]; 52 [[NSGraphicsContext currentContext]
53 cr_setPatternPhase:phase forView:[self cr_viewBeingDrawnTo]];
53 [self drawBackgroundWithOpaque:YES]; 54 [self drawBackgroundWithOpaque:YES];
54 55
55 // Draw top stroke 56 // Draw top stroke
56 [[self strokeColor] set]; 57 [[self strokeColor] set];
57 NSRect borderRect, contentRect; 58 NSRect borderRect, contentRect;
58 NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth], 59 NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth],
59 NSMaxYEdge); 60 NSMaxYEdge);
60 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); 61 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
61 62
62 // Draw the top highlight 63 // Draw the top highlight
(...skipping 19 matching lines...) Expand all
82 83
83 - (ViewID)viewID { 84 - (ViewID)viewID {
84 return VIEW_ID_DOWNLOAD_SHELF; 85 return VIEW_ID_DOWNLOAD_SHELF;
85 } 86 }
86 87
87 - (BOOL)isOpaque { 88 - (BOOL)isOpaque {
88 return YES; 89 return YES;
89 } 90 }
90 91
91 @end 92 @end
OLDNEW
« 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