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_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 - (BOOL)inRapidClosureMode { | 1860 - (BOOL)inRapidClosureMode { |
1861 return availableResizeWidth_ != kUseFullAvailableWidth; | 1861 return availableResizeWidth_ != kUseFullAvailableWidth; |
1862 } | 1862 } |
1863 | 1863 |
1864 // Disable tab dragging when there are any pending animations. | 1864 // Disable tab dragging when there are any pending animations. |
1865 - (BOOL)tabDraggingAllowed { | 1865 - (BOOL)tabDraggingAllowed { |
1866 return [closingControllers_ count] == 0; | 1866 return [closingControllers_ count] == 0; |
1867 } | 1867 } |
1868 | 1868 |
1869 - (void)mouseMoved:(NSEvent*)event { | 1869 - (void)mouseMoved:(NSEvent*)event { |
| 1870 // We don't want the draggged tab to repeatedly redraw its glow unnecessarily. |
| 1871 // We also want the dragged tab to keep the glow even when it slides behind |
| 1872 // another tab. |
| 1873 if ([dragController_ draggedTab]) |
| 1874 return; |
| 1875 |
1870 // Use hit test to figure out what view we are hovering over. | 1876 // Use hit test to figure out what view we are hovering over. |
1871 NSView* targetView = [tabStripView_ hitTest:[event locationInWindow]]; | 1877 NSView* targetView = [tabStripView_ hitTest:[event locationInWindow]]; |
1872 | 1878 |
1873 // Set the new tab button hover state iff the mouse is over the button. | 1879 // Set the new tab button hover state iff the mouse is over the button. |
1874 BOOL shouldShowHoverImage = [targetView isKindOfClass:[NewTabButton class]]; | 1880 BOOL shouldShowHoverImage = [targetView isKindOfClass:[NewTabButton class]]; |
1875 [self setNewTabButtonHoverState:shouldShowHoverImage]; | 1881 [self setNewTabButtonHoverState:shouldShowHoverImage]; |
1876 | 1882 |
1877 TabView* tabView = (TabView*)targetView; | 1883 TabView* tabView = (TabView*)targetView; |
1878 if (![tabView isKindOfClass:[TabView class]]) { | 1884 if (![tabView isKindOfClass:[TabView class]]) { |
1879 if ([[tabView superview] isKindOfClass:[TabView class]]) { | 1885 if ([[tabView superview] isKindOfClass:[TabView class]]) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 // up the hierarchy to the devtools container view to avoid that. Note that | 2320 // up the hierarchy to the devtools container view to avoid that. Note that |
2315 // the devtools view is always in the hierarchy even if it is not open or it | 2321 // the devtools view is always in the hierarchy even if it is not open or it |
2316 // is detached. | 2322 // is detached. |
2317 NSView* devtools_view = [[[view superview] superview] superview]; | 2323 NSView* devtools_view = [[[view superview] superview] superview]; |
2318 if (devtools_view) { | 2324 if (devtools_view) { |
2319 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; | 2325 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; |
2320 } else { | 2326 } else { |
2321 return [view convertRect:[view bounds] toView:nil]; | 2327 return [view convertRect:[view bounds] toView:nil]; |
2322 } | 2328 } |
2323 } | 2329 } |
OLD | NEW |