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/tabs/tab_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
10 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 10 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
11 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" | 11 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
12 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
13 #import "chrome/browser/ui/cocoa/themed_window.h" | 13 #import "chrome/browser/ui/cocoa/themed_window.h" |
14 #import "chrome/browser/ui/cocoa/view_id_util.h" | 14 #import "chrome/browser/ui/cocoa/view_id_util.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
17 #import "ui/base/cocoa/nsgraphics_context_additions.h" | 17 #import "ui/base/cocoa/nsgraphics_context_additions.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 20 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
21 | 21 |
22 | 22 |
23 const int kMaskHeight = 29; // Height of the mask bitmap. | 23 const int kMaskHeight = 29; // Height of the mask bitmap. |
24 const int kFillHeight = 25; // Height of the "mask on" part of the mask bitmap. | 24 const int kFillHeight = 25; // Height of the "mask on" part of the mask bitmap. |
25 | 25 |
26 // Constants for inset and control points for tab shape. | 26 // Constants for inset and control points for tab shape. |
27 const CGFloat kInsetMultiplier = 2.0/3.0; | 27 const CGFloat kInsetMultiplier = 2.0/3.0; |
28 const CGFloat kControlPoint1Multiplier = 1.0/3.0; | |
29 const CGFloat kControlPoint2Multiplier = 3.0/8.0; | |
30 | 28 |
31 // The amount of time in seconds during which each type of glow increases, holds | 29 // The amount of time in seconds during which each type of glow increases, holds |
32 // steady, and decreases, respectively. | 30 // steady, and decreases, respectively. |
33 const NSTimeInterval kHoverShowDuration = 0.2; | 31 const NSTimeInterval kHoverShowDuration = 0.2; |
34 const NSTimeInterval kHoverHoldDuration = 0.02; | 32 const NSTimeInterval kHoverHoldDuration = 0.02; |
35 const NSTimeInterval kHoverHideDuration = 0.4; | 33 const NSTimeInterval kHoverHideDuration = 0.4; |
36 const NSTimeInterval kAlertShowDuration = 0.4; | 34 const NSTimeInterval kAlertShowDuration = 0.4; |
37 const NSTimeInterval kAlertHoldDuration = 0.4; | 35 const NSTimeInterval kAlertHoldDuration = 0.4; |
38 const NSTimeInterval kAlertHideDuration = 0.4; | 36 const NSTimeInterval kAlertHideDuration = 0.4; |
39 | 37 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 CGFloat middleWidth = tabWidth - leftWidth - rightWidth; | 703 CGFloat middleWidth = tabWidth - leftWidth - rightWidth; |
706 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight); | 704 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight); |
707 [[NSColor whiteColor] setFill]; | 705 [[NSColor whiteColor] setFill]; |
708 NSRectFill(middleRect); | 706 NSRectFill(middleRect); |
709 | 707 |
710 maskCache_.reset(CGBitmapContextCreateImage(maskContext)); | 708 maskCache_.reset(CGBitmapContextCreateImage(maskContext)); |
711 return maskCache_; | 709 return maskCache_; |
712 } | 710 } |
713 | 711 |
714 @end // @implementation TabView(Private) | 712 @end // @implementation TabView(Private) |
OLD | NEW |