| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/tab_strip_view.h" | 5 #import "chrome/browser/cocoa/tab_strip_view.h" |
| 6 | 6 |
| 7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
| 8 #import "chrome/browser/cocoa/browser_window_controller.h" | 8 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 9 #import "chrome/browser/cocoa/tab_strip_controller.h" | 9 #import "chrome/browser/cocoa/tab_strip_controller.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Register to be an URL drop target. | 25 // Register to be an URL drop target. |
| 26 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); | 26 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); |
| 27 } | 27 } |
| 28 return self; | 28 return self; |
| 29 } | 29 } |
| 30 | 30 |
| 31 - (void)drawRect:(NSRect)rect { | 31 - (void)drawRect:(NSRect)rect { |
| 32 NSRect boundsRect = [self bounds]; | 32 NSRect boundsRect = [self bounds]; |
| 33 NSRect borderRect, contentRect; | 33 NSRect borderRect, contentRect; |
| 34 |
| 35 // Draw bottom border (a dark border and light highlight). Each tab is |
| 36 // responsible for mimicing this bottom border, unless it's the selected |
| 37 // tab. |
| 38 borderRect = boundsRect; |
| 39 borderRect.origin.y = 1; |
| 40 borderRect.size.height = 1; |
| 41 [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; |
| 42 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 34 NSDivideRect(boundsRect, &borderRect, &contentRect, 1, NSMinYEdge); | 43 NSDivideRect(boundsRect, &borderRect, &contentRect, 1, NSMinYEdge); |
| 35 [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; | 44 [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set]; |
| 36 | |
| 37 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); | 45 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 38 | 46 |
| 39 // Draw drop-indicator arrow (if appropriate). | 47 // Draw drop-indicator arrow (if appropriate). |
| 40 // TODO(viettrungluu): this is all a stop-gap measure. | 48 // TODO(viettrungluu): this is all a stop-gap measure. |
| 41 if ([self dropArrowShown]) { | 49 if ([self dropArrowShown]) { |
| 42 // Programmer art: an arrow parametrized by many knobs. Note that the arrow | 50 // Programmer art: an arrow parametrized by many knobs. Note that the arrow |
| 43 // points downwards (so understand "width" and "height" accordingly). | 51 // points downwards (so understand "width" and "height" accordingly). |
| 44 | 52 |
| 45 // How many (pixels) to inset on the top/bottom. | 53 // How many (pixels) to inset on the top/bottom. |
| 46 const CGFloat kArrowTopInset = 1.5; | 54 const CGFloat kArrowTopInset = 1.5; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 168 } |
| 161 | 169 |
| 162 - (id)accessibilityAttributeValue:(NSString*)attribute { | 170 - (id)accessibilityAttributeValue:(NSString*)attribute { |
| 163 if ([attribute isEqual:NSAccessibilityRoleAttribute]) | 171 if ([attribute isEqual:NSAccessibilityRoleAttribute]) |
| 164 return NSAccessibilityGroupRole; | 172 return NSAccessibilityGroupRole; |
| 165 | 173 |
| 166 return [super accessibilityAttributeValue:attribute]; | 174 return [super accessibilityAttributeValue:attribute]; |
| 167 } | 175 } |
| 168 | 176 |
| 169 @end | 177 @end |
| OLD | NEW |