OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |