| 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 #include "chrome/browser/cocoa/nsimage_cache.h" | 5 #include "chrome/browser/cocoa/nsimage_cache.h" |
| 6 #include "chrome/browser/cocoa/tab_controller.h" | 6 #include "chrome/browser/cocoa/tab_controller.h" |
| 7 #include "chrome/browser/cocoa/tab_view.h" | 7 #include "chrome/browser/cocoa/tab_view.h" |
| 8 #include "chrome/browser/cocoa/tab_window_controller.h" | 8 #include "chrome/browser/cocoa/tab_window_controller.h" |
| 9 | 9 |
| 10 | 10 |
| 11 // Constants for inset and control points for tab shape. | 11 // Constants for inset and control points for tab shape. |
| 12 static const CGFloat kInsetMultiplier = 2.0/3.0; | 12 static const CGFloat kInsetMultiplier = 2.0/3.0; |
| 13 static const CGFloat kControlPoint1Multiplier = 1.0/3.0; | 13 static const CGFloat kControlPoint1Multiplier = 1.0/3.0; |
| 14 static const CGFloat kControlPoint2Multiplier = 3.0/8.0; | 14 static const CGFloat kControlPoint2Multiplier = 3.0/8.0; |
| 15 | 15 |
| 16 static const CGFloat kToolbarTopOffset = 12; | |
| 17 static const CGFloat kToolbarMaxHeight = 128; | |
| 18 | |
| 19 @implementation TabView | 16 @implementation TabView |
| 20 | 17 |
| 21 @synthesize state = state_; | 18 @synthesize state = state_; |
| 22 | 19 |
| 23 - (id)initWithFrame:(NSRect)frame { | 20 - (id)initWithFrame:(NSRect)frame { |
| 24 self = [super initWithFrame:frame]; | 21 self = [super initWithFrame:frame]; |
| 25 if (self) { | 22 if (self) { |
| 26 chromeIsVisible_ = YES; | 23 chromeIsVisible_ = YES; |
| 27 [self setShowsDivider:NO]; | 24 [self setShowsDivider:NO]; |
| 28 // TODO(alcor): register for theming, either here or the cell | 25 // TODO(alcor): register for theming, either here or the cell |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 [[NSGraphicsContext currentContext] restoreGraphicsState]; | 498 [[NSGraphicsContext currentContext] restoreGraphicsState]; |
| 502 } | 499 } |
| 503 | 500 |
| 504 // Called when the user hits the right mouse button (or control-clicks) to | 501 // Called when the user hits the right mouse button (or control-clicks) to |
| 505 // show a context menu. | 502 // show a context menu. |
| 506 - (void)rightMouseDown:(NSEvent*)theEvent { | 503 - (void)rightMouseDown:(NSEvent*)theEvent { |
| 507 [NSMenu popUpContextMenu:[self menu] withEvent:theEvent forView:self]; | 504 [NSMenu popUpContextMenu:[self menu] withEvent:theEvent forView:self]; |
| 508 } | 505 } |
| 509 | 506 |
| 510 @end | 507 @end |
| OLD | NEW |