OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media_indicator_button_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/tabs/media_indicator_button_cocoa.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/macros.h" |
9 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 11 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
11 #include "content/public/browser/user_metrics.h" | 12 #include "content/public/browser/user_metrics.h" |
12 #include "ui/gfx/animation/animation.h" | 13 #include "ui/gfx/animation/animation.h" |
13 #include "ui/gfx/animation/animation_delegate.h" | 14 #include "ui/gfx/animation/animation_delegate.h" |
14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 // The minimum required click-to-select area of an inactive tab before allowing | 19 // The minimum required click-to-select area of an inactive tab before allowing |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if (enable && tabView && ([tabView state] != NSOnState)) { | 231 if (enable && tabView && ([tabView state] != NSOnState)) { |
231 const int requiredWidth = | 232 const int requiredWidth = |
232 NSWidth([self frame]) * kMinMouseSelectableAreaPercent / 100; | 233 NSWidth([self frame]) * kMinMouseSelectableAreaPercent / 100; |
233 enable = ([tabView widthOfLargestSelectableRegion] >= requiredWidth); | 234 enable = ([tabView widthOfLargestSelectableRegion] >= requiredWidth); |
234 } | 235 } |
235 | 236 |
236 [self setEnabled:enable]; | 237 [self setEnabled:enable]; |
237 } | 238 } |
238 | 239 |
239 @end | 240 @end |
OLD | NEW |