| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/plugin/plugin_interpose_util_mac.h" | 5 #include "content/plugin/plugin_interpose_util_mac.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
| 9 | 9 |
| 10 #include "content/common/plugin_messages.h" | 10 #include "content/common/plugin_messages.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 | 85 |
| 86 void NotifyPluginOfSetCursorVisibility(bool visibility) { | 86 void NotifyPluginOfSetCursorVisibility(bool visibility) { |
| 87 PluginThread* plugin_thread = PluginThread::current(); | 87 PluginThread* plugin_thread = PluginThread::current(); |
| 88 if (plugin_thread) { | 88 if (plugin_thread) { |
| 89 plugin_thread->Send( | 89 plugin_thread->Send( |
| 90 new PluginProcessHostMsg_PluginSetCursorVisibility(visibility)); | 90 new PluginProcessHostMsg_PluginSetCursorVisibility(visibility)); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 __attribute__((visibility("default"))) | |
| 95 bool GetPluginWindowHasFocus(const OpaquePluginRef delegate) { | |
| 96 return static_cast<webkit::npapi::WebPluginDelegateImpl*>( | |
| 97 delegate)->GetWindowHasFocus(); | |
| 98 } | |
| 99 | |
| 100 } // namespace mac_plugin_interposing | 94 } // namespace mac_plugin_interposing |
| 101 | 95 |
| 102 #pragma mark - | 96 #pragma mark - |
| 103 | 97 |
| 104 struct WindowInfo { | 98 struct WindowInfo { |
| 105 uint32 window_id; | 99 uint32 window_id; |
| 106 CGRect bounds; | 100 CGRect bounds; |
| 107 WindowInfo(NSWindow* window) { | 101 WindowInfo(NSWindow* window) { |
| 108 NSInteger window_num = [window windowNumber]; | 102 NSInteger window_num = [window windowNumber]; |
| 109 window_id = window_num > 0 ? window_num : 0; | 103 window_id = window_num > 0 ? window_num : 0; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 Class nscursor_class = [NSCursor class]; | 291 Class nscursor_class = [NSCursor class]; |
| 298 ExchangeMethods(nscursor_class, NO, @selector(set), | 292 ExchangeMethods(nscursor_class, NO, @selector(set), |
| 299 @selector(chromePlugin_set)); | 293 @selector(chromePlugin_set)); |
| 300 ExchangeMethods(nscursor_class, YES, @selector(hide), | 294 ExchangeMethods(nscursor_class, YES, @selector(hide), |
| 301 @selector(chromePlugin_hide)); | 295 @selector(chromePlugin_hide)); |
| 302 ExchangeMethods(nscursor_class, YES, @selector(unhide), | 296 ExchangeMethods(nscursor_class, YES, @selector(unhide), |
| 303 @selector(chromePlugin_unhide)); | 297 @selector(chromePlugin_unhide)); |
| 304 } | 298 } |
| 305 | 299 |
| 306 } // namespace mac_plugin_interposing | 300 } // namespace mac_plugin_interposing |
| OLD | NEW |