summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_interpose_util_mac.h12
-rw-r--r--chrome/plugin/plugin_interpose_util_mac.mm18
2 files changed, 16 insertions, 14 deletions
diff --git a/chrome/plugin/plugin_interpose_util_mac.h b/chrome/plugin/plugin_interpose_util_mac.h
index 00119a7..879fc65 100644
--- a/chrome/plugin/plugin_interpose_util_mac.h
+++ b/chrome/plugin/plugin_interpose_util_mac.h
@@ -10,7 +10,9 @@
#import "base/basictypes.h"
-class WebPluginDelegateImpl;
+// This is really a WebPluginDelegateImpl, but that class is private to the
+// framework, and these functions are called from a dylib.
+typedef void* OpaquePluginRef;
namespace mac_plugin_interposing {
@@ -22,7 +24,7 @@ void SetUpCocoaInterposing();
void SwitchToPluginProcess();
// Returns the delegate currently processing events.
-WebPluginDelegateImpl* GetActiveDelegate();
+OpaquePluginRef GetActiveDelegate();
// Sends a message to the browser process to inform it that the given window
// has been brought forward.
@@ -40,15 +42,15 @@ void NotifyBrowserOfPluginShowWindow(uint32 window_id, CGRect bounds,
void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds);
// Sends a message to the plugin that a theme cursor was set.
-void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate,
+void NotifyPluginOfSetThemeCursor(OpaquePluginRef delegate,
ThemeCursor cursor);
// Sends a message to the plugin that a cursor was set.
-void NotifyPluginOfSetCursor(WebPluginDelegateImpl* delegate,
+void NotifyPluginOfSetCursor(OpaquePluginRef delegate,
const Cursor* cursor);
// Returns true if the window containing the given plugin delegate is focused.
-bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate);
+bool GetPluginWindowHasFocus(const OpaquePluginRef delegate);
} // namespace MacPluginInterpose
diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm
index 10f1639..45df449 100644
--- a/chrome/plugin/plugin_interpose_util_mac.mm
+++ b/chrome/plugin/plugin_interpose_util_mac.mm
@@ -31,7 +31,7 @@ void SwitchToPluginProcess() {
}
__attribute__((visibility("default")))
-WebPluginDelegateImpl* GetActiveDelegate() {
+OpaquePluginRef GetActiveDelegate() {
return WebPluginDelegateImpl::GetActiveDelegate();
}
@@ -70,15 +70,15 @@ void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds) {
}
__attribute__((visibility("default")))
-void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate,
+void NotifyPluginOfSetThemeCursor(OpaquePluginRef delegate,
ThemeCursor cursor) {
- delegate->SetThemeCursor(cursor);
+ static_cast<WebPluginDelegateImpl*>(delegate)->SetThemeCursor(cursor);
}
__attribute__((visibility("default")))
-void NotifyPluginOfSetCursor(WebPluginDelegateImpl* delegate,
+void NotifyPluginOfSetCursor(OpaquePluginRef delegate,
const Cursor* cursor) {
- delegate->SetCursor(cursor);
+ static_cast<WebPluginDelegateImpl*>(delegate)->SetCursor(cursor);
}
void NotifyPluginOfSetCursorVisibility(bool visibility) {
@@ -90,8 +90,8 @@ void NotifyPluginOfSetCursorVisibility(bool visibility) {
}
__attribute__((visibility("default")))
-bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate) {
- return delegate->GetWindowHasFocus();
+bool GetPluginWindowHasFocus(const OpaquePluginRef delegate) {
+ return static_cast<WebPluginDelegateImpl*>(delegate)->GetWindowHasFocus();
}
} // namespace mac_plugin_interposing
@@ -235,9 +235,9 @@ static void OnPluginWindowShown(const WindowInfo& window_info, BOOL is_modal) {
@implementation NSCursor (ChromePluginInterposing)
- (void)chromePlugin_set {
- WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate();
+ OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate();
if (delegate) {
- delegate->SetNSCursor(self);
+ static_cast<WebPluginDelegateImpl*>(delegate)->SetNSCursor(self);
return;
}
[self chromePlugin_set];