| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/browser_theme_provider.h" |
| 8 #import "chrome/browser/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 9 #import "chrome/browser/cocoa/tab_strip_controller.h" | 10 #import "chrome/browser/cocoa/tab_strip_controller.h" |
| 10 #import "chrome/browser/cocoa/view_id_util.h" | 11 #import "chrome/browser/cocoa/view_id_util.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 | 13 |
| 13 @implementation TabStripView | 14 @implementation TabStripView |
| 14 | 15 |
| 15 @synthesize newTabButton = newTabButton_; | 16 @synthesize newTabButton = newTabButton_; |
| 16 @synthesize dropArrowShown = dropArrowShown_; | 17 @synthesize dropArrowShown = dropArrowShown_; |
| 17 @synthesize dropArrowPosition = dropArrowPosition_; | 18 @synthesize dropArrowPosition = dropArrowPosition_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 34 // tab. | 35 // tab. |
| 35 - (void)drawBorder:(NSRect)bounds { | 36 - (void)drawBorder:(NSRect)bounds { |
| 36 NSRect borderRect, contentRect; | 37 NSRect borderRect, contentRect; |
| 37 | 38 |
| 38 borderRect = bounds; | 39 borderRect = bounds; |
| 39 borderRect.origin.y = 1; | 40 borderRect.origin.y = 1; |
| 40 borderRect.size.height = 1; | 41 borderRect.size.height = 1; |
| 41 [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; | 42 [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; |
| 42 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); | 43 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 43 NSDivideRect(bounds, &borderRect, &contentRect, 1, NSMinYEdge); | 44 NSDivideRect(bounds, &borderRect, &contentRect, 1, NSMinYEdge); |
| 44 [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set]; | 45 |
| 46 BrowserThemeProvider* themeProvider = |
| 47 static_cast<BrowserThemeProvider*>([[self window] themeProvider]); |
| 48 if (!themeProvider) |
| 49 return; |
| 50 |
| 51 NSColor* bezelColor = themeProvider->GetNSColor( |
| 52 themeProvider->UsingDefaultTheme() ? |
| 53 BrowserThemeProvider::COLOR_TOOLBAR_BEZEL : |
| 54 BrowserThemeProvider::COLOR_TOOLBAR, true); |
| 55 [bezelColor set]; |
| 56 NSRectFill(borderRect); |
| 45 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); | 57 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 46 } | 58 } |
| 47 | 59 |
| 48 - (void)drawRect:(NSRect)rect { | 60 - (void)drawRect:(NSRect)rect { |
| 49 NSRect boundsRect = [self bounds]; | 61 NSRect boundsRect = [self bounds]; |
| 50 | 62 |
| 51 [self drawBorder:boundsRect]; | 63 [self drawBorder:boundsRect]; |
| 52 | 64 |
| 53 // Draw drop-indicator arrow (if appropriate). | 65 // Draw drop-indicator arrow (if appropriate). |
| 54 // TODO(viettrungluu): this is all a stop-gap measure. | 66 // TODO(viettrungluu): this is all a stop-gap measure. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 return NSAccessibilityGroupRole; | 202 return NSAccessibilityGroupRole; |
| 191 | 203 |
| 192 return [super accessibilityAttributeValue:attribute]; | 204 return [super accessibilityAttributeValue:attribute]; |
| 193 } | 205 } |
| 194 | 206 |
| 195 - (ViewID)viewID { | 207 - (ViewID)viewID { |
| 196 return VIEW_ID_TAB_STRIP; | 208 return VIEW_ID_TAB_STRIP; |
| 197 } | 209 } |
| 198 | 210 |
| 199 @end | 211 @end |
| OLD | NEW |