| 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_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 #import "chrome/browser/cocoa/tab_controller.h" | 9 #import "chrome/browser/cocoa/tab_controller.h" |
| 10 #import "chrome/browser/cocoa/tab_window_controller.h" | 10 #import "chrome/browser/cocoa/tab_window_controller.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 - (void)cancelAlert { | 787 - (void)cancelAlert { |
| 788 if (alertState_ != tabs::kAlertNone) { | 788 if (alertState_ != tabs::kAlertNone) { |
| 789 alertState_ = tabs::kAlertFalling; | 789 alertState_ = tabs::kAlertFalling; |
| 790 alertHoldEndTime_ = | 790 alertHoldEndTime_ = |
| 791 [NSDate timeIntervalSinceReferenceDate] + kGlowUpdateInterval; | 791 [NSDate timeIntervalSinceReferenceDate] + kGlowUpdateInterval; |
| 792 [self resetLastGlowUpdateTime]; | 792 [self resetLastGlowUpdateTime]; |
| 793 [self adjustGlowValue]; | 793 [self adjustGlowValue]; |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 - (BOOL)accessibilityIsIgnored { |
| 798 return NO; |
| 799 } |
| 800 |
| 801 - (NSArray*)accessibilityActionNames { |
| 802 NSArray* parentActions = [super accessibilityActionNames]; |
| 803 |
| 804 return [parentActions arrayByAddingObject:NSAccessibilityPressAction]; |
| 805 } |
| 806 |
| 807 - (id)accessibilityAttributeValue:(NSString*)attribute { |
| 808 if ([attribute isEqual:NSAccessibilityRoleAttribute]) |
| 809 return NSAccessibilityButtonRole; |
| 810 |
| 811 return [super accessibilityAttributeValue:attribute]; |
| 812 } |
| 813 |
| 797 @end // @implementation TabView | 814 @end // @implementation TabView |
| 798 | 815 |
| 799 @implementation TabView(Private) | 816 @implementation TabView(Private) |
| 800 | 817 |
| 801 - (void)resetLastGlowUpdateTime { | 818 - (void)resetLastGlowUpdateTime { |
| 802 lastGlowUpdate_ = [NSDate timeIntervalSinceReferenceDate]; | 819 lastGlowUpdate_ = [NSDate timeIntervalSinceReferenceDate]; |
| 803 } | 820 } |
| 804 | 821 |
| 805 - (NSTimeInterval)timeElapsedSinceLastGlowUpdate { | 822 - (NSTimeInterval)timeElapsedSinceLastGlowUpdate { |
| 806 return [NSDate timeIntervalSinceReferenceDate] - lastGlowUpdate_; | 823 return [NSDate timeIntervalSinceReferenceDate] - lastGlowUpdate_; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 } | 896 } |
| 880 | 897 |
| 881 if (nextUpdate < kNoUpdate) | 898 if (nextUpdate < kNoUpdate) |
| 882 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; | 899 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; |
| 883 | 900 |
| 884 [self resetLastGlowUpdateTime]; | 901 [self resetLastGlowUpdateTime]; |
| 885 [self setNeedsDisplay:YES]; | 902 [self setNeedsDisplay:YES]; |
| 886 } | 903 } |
| 887 | 904 |
| 888 @end // @implementation TabView(Private) | 905 @end // @implementation TabView(Private) |
| OLD | NEW |