| 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_strip_controller.h" | 5 #import "chrome/browser/cocoa/tab_strip_controller.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 ~ScopedNSAnimationContextGroup() { | 81 ~ScopedNSAnimationContextGroup() { |
| 82 if (animate_) { | 82 if (animate_) { |
| 83 [NSAnimationContext endGrouping]; | 83 [NSAnimationContext endGrouping]; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void SetCurrentContextDuration(NSTimeInterval duration) { | 87 void SetCurrentContextDuration(NSTimeInterval duration) { |
| 88 if (animate_) { | 88 if (animate_) { |
| 89 [[NSAnimationContext currentContext] gtm_setDuration:duration]; | 89 [[NSAnimationContext currentContext] gtm_setDuration:duration |
| 90 eventMask:NSLeftMouseDownMask]; |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 | 93 |
| 93 void SetCurrentContextShortestDuration() { | 94 void SetCurrentContextShortestDuration() { |
| 94 if (animate_) { | 95 if (animate_) { |
| 95 // The minimum representable time interval. This used to stop an | 96 // The minimum representable time interval. This used to stop an |
| 96 // in-progress animation as quickly as possible. | 97 // in-progress animation as quickly as possible. |
| 97 const NSTimeInterval kMinimumTimeInterval = | 98 const NSTimeInterval kMinimumTimeInterval = |
| 98 std::numeric_limits<NSTimeInterval>::min(); | 99 std::numeric_limits<NSTimeInterval>::min(); |
| 99 // Directly set the duration to be short, avoiding the Steve slowmotion | 100 // Directly set the duration to be short, avoiding the Steve slowmotion |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1729 return; | 1730 return; |
| 1730 | 1731 |
| 1731 TabContentsController* tabController = | 1732 TabContentsController* tabController = |
| 1732 [tabContentsArray_ objectAtIndex:index]; | 1733 [tabContentsArray_ objectAtIndex:index]; |
| 1733 TabContents* devtoolsContents = contents ? | 1734 TabContents* devtoolsContents = contents ? |
| 1734 DevToolsWindow::GetDevToolsContents(contents) : NULL; | 1735 DevToolsWindow::GetDevToolsContents(contents) : NULL; |
| 1735 [tabController showDevToolsContents:devtoolsContents]; | 1736 [tabController showDevToolsContents:devtoolsContents]; |
| 1736 } | 1737 } |
| 1737 | 1738 |
| 1738 @end | 1739 @end |
| OLD | NEW |