| 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_view.h" | 5 #import "chrome/browser/cocoa/tab_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/nsimage_cache_mac.h" | 8 #include "base/nsimage_cache_mac.h" |
| 9 #include "chrome/browser/browser_theme_provider.h" | 9 #include "chrome/browser/browser_theme_provider.h" |
| 10 #import "chrome/browser/cocoa/tab_controller.h" | 10 #import "chrome/browser/cocoa/tab_controller.h" |
| 11 #import "chrome/browser/cocoa/tab_window_controller.h" | 11 #import "chrome/browser/cocoa/tab_window_controller.h" |
| 12 #import "chrome/browser/cocoa/themed_window.h" | 12 #import "chrome/browser/cocoa/themed_window.h" |
| 13 #import "chrome/browser/cocoa/view_id_util.h" |
| 13 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 // Constants for inset and control points for tab shape. | 18 // Constants for inset and control points for tab shape. |
| 18 const CGFloat kInsetMultiplier = 2.0/3.0; | 19 const CGFloat kInsetMultiplier = 2.0/3.0; |
| 19 const CGFloat kControlPoint1Multiplier = 1.0/3.0; | 20 const CGFloat kControlPoint1Multiplier = 1.0/3.0; |
| 20 const CGFloat kControlPoint2Multiplier = 3.0/8.0; | 21 const CGFloat kControlPoint2Multiplier = 3.0/8.0; |
| 21 | 22 |
| 22 // The amount of time in seconds during which each type of glow increases, holds | 23 // The amount of time in seconds during which each type of glow increases, holds |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 if ([child isKindOfClass:[NSButtonCell class]]) | 858 if ([child isKindOfClass:[NSButtonCell class]]) |
| 858 [okChildren addObject:child]; | 859 [okChildren addObject:child]; |
| 859 } | 860 } |
| 860 | 861 |
| 861 return okChildren; | 862 return okChildren; |
| 862 } | 863 } |
| 863 | 864 |
| 864 return [super accessibilityAttributeValue:attribute]; | 865 return [super accessibilityAttributeValue:attribute]; |
| 865 } | 866 } |
| 866 | 867 |
| 868 // Tag is used solely for ViewID. Override to prevent changing of it. |
| 869 - (NSInteger)tag { |
| 870 return view_id_util::ViewIDToTag([controller_ viewID]); |
| 871 } |
| 872 |
| 867 @end // @implementation TabView | 873 @end // @implementation TabView |
| 868 | 874 |
| 869 @implementation TabView (TabControllerInterface) | 875 @implementation TabView (TabControllerInterface) |
| 870 | 876 |
| 871 - (void)setController:(TabController*)controller { | 877 - (void)setController:(TabController*)controller { |
| 872 controller_ = controller; | 878 controller_ = controller; |
| 873 } | 879 } |
| 874 | 880 |
| 875 @end // @implementation TabView (TabControllerInterface) | 881 @end // @implementation TabView (TabControllerInterface) |
| 876 | 882 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 } | 963 } |
| 958 | 964 |
| 959 if (nextUpdate < kNoUpdate) | 965 if (nextUpdate < kNoUpdate) |
| 960 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; | 966 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; |
| 961 | 967 |
| 962 [self resetLastGlowUpdateTime]; | 968 [self resetLastGlowUpdateTime]; |
| 963 [self setNeedsDisplay:YES]; | 969 [self setNeedsDisplay:YES]; |
| 964 } | 970 } |
| 965 | 971 |
| 966 @end // @implementation TabView(Private) | 972 @end // @implementation TabView(Private) |
| OLD | NEW |