| 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 #include "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <CoreServices/CoreServices.h> | 9 #include <CoreServices/CoreServices.h> |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool IsVisible(gfx::NativeView view) { | 149 bool IsVisible(gfx::NativeView view) { |
| 150 // A reasonable approximation of how you'd expect this to behave. | 150 // A reasonable approximation of how you'd expect this to behave. |
| 151 return (view && | 151 return (view && |
| 152 ![view isHiddenOrHasHiddenAncestor] && | 152 ![view isHiddenOrHasHiddenAncestor] && |
| 153 [view window] && | 153 [view window] && |
| 154 [[view window] isVisible]); | 154 [[view window] isVisible]); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool IsSwipeTrackingFromScrollEventsEnabled() { |
| 158 SEL selector = @selector(isSwipeTrackingFromScrollEventsEnabled); |
| 159 return [NSEvent respondsToSelector:selector] |
| 160 && [NSEvent performSelector:selector]; |
| 161 } |
| 162 |
| 157 } // namespace platform_util | 163 } // namespace platform_util |
| OLD | NEW |