| 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_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.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/tabs/tab_strip_controller.h" | 9 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/view_id_util.h" | 10 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 - (NSPoint)patternPhase { | 47 - (NSPoint)patternPhase { |
| 48 // We want our backgrounds for the shelf to be phased from the upper | 48 // We want our backgrounds for the shelf to be phased from the upper |
| 49 // left hand corner of the view. Offset it by tab height so that the | 49 // left hand corner of the view. Offset it by tab height so that the |
| 50 // background matches the toolbar background. | 50 // background matches the toolbar background. |
| 51 return NSMakePoint( | 51 return NSMakePoint( |
| 52 0, NSHeight([self bounds]) + [TabStripController defaultTabHeight]); | 52 0, NSHeight([self bounds]) + [TabStripController defaultTabHeight]); |
| 53 } | 53 } |
| 54 | 54 |
| 55 - (void)drawRect:(NSRect)dirtyRect { | 55 - (void)drawRect:(NSRect)dirtyRect { |
| 56 [super drawRect:dirtyRect]; | 56 [self drawBackground:dirtyRect]; |
| 57 | 57 |
| 58 // Draw top stroke | 58 // Draw top stroke |
| 59 NSRect borderRect, contentRect; | 59 NSRect borderRect, contentRect; |
| 60 NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth], | 60 NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth], |
| 61 NSMaxYEdge); | 61 NSMaxYEdge); |
| 62 if (NSIntersectsRect(borderRect, dirtyRect)) { | 62 if (NSIntersectsRect(borderRect, dirtyRect)) { |
| 63 [[self strokeColor] set]; | 63 [[self strokeColor] set]; |
| 64 NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect), | 64 NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect), |
| 65 NSCompositeSourceOver); | 65 NSCompositeSourceOver); |
| 66 } | 66 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 - (ViewID)viewID { | 92 - (ViewID)viewID { |
| 93 return VIEW_ID_DOWNLOAD_SHELF; | 93 return VIEW_ID_DOWNLOAD_SHELF; |
| 94 } | 94 } |
| 95 | 95 |
| 96 - (BOOL)isOpaque { | 96 - (BOOL)isOpaque { |
| 97 return YES; | 97 return YES; |
| 98 } | 98 } |
| 99 | 99 |
| 100 @end | 100 @end |
| OLD | NEW |