| 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" |
| 11 #include "content/plugin/plugin_thread.h" | 11 #include "content/plugin/plugin_thread.h" |
| 12 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 12 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 13 | 13 |
| 14 using content::PluginThread; |
| 15 |
| 14 namespace mac_plugin_interposing { | 16 namespace mac_plugin_interposing { |
| 15 | 17 |
| 16 // TODO(stuartmorgan): Make this an IPC to order the plugin process above the | 18 // TODO(stuartmorgan): Make this an IPC to order the plugin process above the |
| 17 // browser process only if the browser is current frontmost. | 19 // browser process only if the browser is current frontmost. |
| 18 __attribute__((visibility("default"))) | 20 __attribute__((visibility("default"))) |
| 19 void SwitchToPluginProcess() { | 21 void SwitchToPluginProcess() { |
| 20 ProcessSerialNumber this_process, front_process; | 22 ProcessSerialNumber this_process, front_process; |
| 21 if ((GetCurrentProcess(&this_process) != noErr) || | 23 if ((GetCurrentProcess(&this_process) != noErr) || |
| 22 (GetFrontProcess(&front_process) != noErr)) { | 24 (GetFrontProcess(&front_process) != noErr)) { |
| 23 return; | 25 return; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 Class nscursor_class = [NSCursor class]; | 282 Class nscursor_class = [NSCursor class]; |
| 281 ExchangeMethods(nscursor_class, NO, @selector(set), | 283 ExchangeMethods(nscursor_class, NO, @selector(set), |
| 282 @selector(chromePlugin_set)); | 284 @selector(chromePlugin_set)); |
| 283 ExchangeMethods(nscursor_class, YES, @selector(hide), | 285 ExchangeMethods(nscursor_class, YES, @selector(hide), |
| 284 @selector(chromePlugin_hide)); | 286 @selector(chromePlugin_hide)); |
| 285 ExchangeMethods(nscursor_class, YES, @selector(unhide), | 287 ExchangeMethods(nscursor_class, YES, @selector(unhide), |
| 286 @selector(chromePlugin_unhide)); | 288 @selector(chromePlugin_unhide)); |
| 287 } | 289 } |
| 288 | 290 |
| 289 } // namespace mac_plugin_interposing | 291 } // namespace mac_plugin_interposing |
| OLD | NEW |