| 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/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/sdk_forward_declarations.h" | 9 #include "base/mac/sdk_forward_declarations.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return YES; | 129 return YES; |
| 130 } | 130 } |
| 131 | 131 |
| 132 - (void)mouseEntered:(NSEvent*)theEvent { | 132 - (void)mouseEntered:(NSEvent*)theEvent { |
| 133 isMouseInside_ = YES; | 133 isMouseInside_ = YES; |
| 134 [self resetLastGlowUpdateTime]; | 134 [self resetLastGlowUpdateTime]; |
| 135 [self adjustGlowValue]; | 135 [self adjustGlowValue]; |
| 136 } | 136 } |
| 137 | 137 |
| 138 - (void)mouseMoved:(NSEvent*)theEvent { | 138 - (void)mouseMoved:(NSEvent*)theEvent { |
| 139 hoverPoint_ = [self convertPoint:[theEvent locationInWindow] | 139 if (state_ == NSOffState) { |
| 140 fromView:nil]; | 140 hoverPoint_ = [self convertPoint:[theEvent locationInWindow] fromView:nil]; |
| 141 [self setNeedsDisplay:YES]; | 141 [self setNeedsDisplay:YES]; |
| 142 } |
| 142 } | 143 } |
| 143 | 144 |
| 144 - (void)mouseExited:(NSEvent*)theEvent { | 145 - (void)mouseExited:(NSEvent*)theEvent { |
| 145 isMouseInside_ = NO; | 146 isMouseInside_ = NO; |
| 146 hoverHoldEndTime_ = | 147 hoverHoldEndTime_ = |
| 147 [NSDate timeIntervalSinceReferenceDate] + kHoverHoldDuration; | 148 [NSDate timeIntervalSinceReferenceDate] + kHoverHoldDuration; |
| 148 [self resetLastGlowUpdateTime]; | 149 [self resetLastGlowUpdateTime]; |
| 149 [self adjustGlowValue]; | 150 [self adjustGlowValue]; |
| 150 } | 151 } |
| 151 | 152 |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 CGFloat middleWidth = tabWidth - leftWidth - rightWidth; | 787 CGFloat middleWidth = tabWidth - leftWidth - rightWidth; |
| 787 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight); | 788 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight); |
| 788 [[NSColor whiteColor] setFill]; | 789 [[NSColor whiteColor] setFill]; |
| 789 NSRectFill(middleRect); | 790 NSRectFill(middleRect); |
| 790 | 791 |
| 791 maskCache_.reset(CGBitmapContextCreateImage(maskContext)); | 792 maskCache_.reset(CGBitmapContextCreateImage(maskContext)); |
| 792 return maskCache_; | 793 return maskCache_; |
| 793 } | 794 } |
| 794 | 795 |
| 795 @end // @implementation TabView(Private) | 796 @end // @implementation TabView(Private) |
| OLD | NEW |