diff options
-rw-r--r-- | chrome/app/framework.order | 12 | ||||
-rw-r--r-- | chrome/browser/plugin_carbon_interpose_mac.cc | 12 | ||||
-rw-r--r-- | chrome/plugin/plugin_interpose_util_mac.h | 12 | ||||
-rw-r--r-- | chrome/plugin/plugin_interpose_util_mac.mm | 18 | ||||
-rw-r--r-- | webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc | 8 | ||||
-rw-r--r-- | webkit/glue/plugins/carbon_plugin_window_tracker_mac.h | 16 |
6 files changed, 41 insertions, 37 deletions
diff --git a/chrome/app/framework.order b/chrome/app/framework.order index c527f6e..39e19e5 100644 --- a/chrome/app/framework.order +++ b/chrome/app/framework.order @@ -27,16 +27,16 @@ __ZN22mac_plugin_interposing17GetActiveDelegateEv __ZN22mac_plugin_interposing33NotifyBrowserOfPluginSelectWindowEj6CGRectb __ZN22mac_plugin_interposing31NotifyBrowserOfPluginShowWindowEj6CGRectb __ZN22mac_plugin_interposing31NotifyBrowserOfPluginHideWindowEj6CGRect -__ZN22mac_plugin_interposing28NotifyPluginOfSetThemeCursorEP21WebPluginDelegateImplm -__ZN22mac_plugin_interposing23NotifyPluginOfSetCursorEP21WebPluginDelegateImplPK6Cursor -__ZN22mac_plugin_interposing23GetPluginWindowHasFocusEPK21WebPluginDelegateImpl +__ZN22mac_plugin_interposing28NotifyPluginOfSetThemeCursorEPvm +__ZN22mac_plugin_interposing23NotifyPluginOfSetCursorEPvPK6Cursor +__ZN22mac_plugin_interposing23GetPluginWindowHasFocusEPv __ZN25CarbonPluginWindowTrackerC1Ev __ZN25CarbonPluginWindowTrackerC2Ev __ZN25CarbonPluginWindowTracker14SharedInstanceEv -__ZN25CarbonPluginWindowTracker28CreateDummyWindowForDelegateEP21WebPluginDelegateImpl +__ZN25CarbonPluginWindowTracker28CreateDummyWindowForDelegateEPv __ZNK25CarbonPluginWindowTracker25GetDelegateForDummyWindowEP15OpaqueWindowPtr -__ZNK25CarbonPluginWindowTracker25GetDummyWindowForDelegateEP21WebPluginDelegateImpl -__ZN25CarbonPluginWindowTracker29DestroyDummyWindowForDelegateEP21WebPluginDelegateImplP15OpaqueWindowPtr +__ZNK25CarbonPluginWindowTracker25GetDummyWindowForDelegateEPv +__ZN25CarbonPluginWindowTracker29DestroyDummyWindowForDelegateEPvP15OpaqueWindowPtr __ZN7WebCore22narrowPrecisionToFloatIdEEfT_ __ZN7WebCore24narrowPrecisionToCGFloatIdEEfT_ __ZnwmPv diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc index e0e304f..55e1405 100644 --- a/chrome/browser/plugin_carbon_interpose_mac.cc +++ b/chrome/browser/plugin_carbon_interpose_mac.cc @@ -20,7 +20,7 @@ static bool IsModalWindow(WindowRef window) { return (status == noErr) && (modality != kWindowModalityNone); } -static bool IsContainingWindowActive(const WebPluginDelegateImpl* delegate) { +static bool IsContainingWindowActive(const OpaquePluginRef delegate) { return mac_plugin_interposing::GetPluginWindowHasFocus(delegate); } @@ -60,7 +60,7 @@ static void OnPluginWindowSelected(WindowRef window) { #pragma mark - static Boolean ChromePluginIsWindowActive(WindowRef window) { - const WebPluginDelegateImpl* delegate = + const OpaquePluginRef delegate = CarbonPluginWindowTracker::SharedInstance()->GetDelegateForDummyWindow( window); return delegate ? IsContainingWindowActive(delegate) @@ -68,7 +68,7 @@ static Boolean ChromePluginIsWindowActive(WindowRef window) { } static Boolean ChromePluginIsWindowHilited(WindowRef window) { - const WebPluginDelegateImpl* delegate = + const OpaquePluginRef delegate = CarbonPluginWindowTracker::SharedInstance()->GetDelegateForDummyWindow( window); return delegate ? IsContainingWindowActive(delegate) @@ -125,7 +125,7 @@ static void ChromePluginDisposeDialog(DialogRef dialog) { } static WindowPartCode ChromePluginFindWindow(Point point, WindowRef* window) { - WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate(); + OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate(); CarbonPluginWindowTracker* tracker = CarbonPluginWindowTracker::SharedInstance(); WindowRef plugin_window = tracker->GetDummyWindowForDelegate(delegate); @@ -146,7 +146,7 @@ static WindowPartCode ChromePluginFindWindow(Point point, WindowRef* window) { } static OSStatus ChromePluginSetThemeCursor(ThemeCursor cursor) { - WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate(); + OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate(); if (delegate) { mac_plugin_interposing::NotifyPluginOfSetThemeCursor(delegate, cursor); return noErr; @@ -155,7 +155,7 @@ static OSStatus ChromePluginSetThemeCursor(ThemeCursor cursor) { } static void ChromePluginSetCursor(const Cursor* cursor) { - WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate(); + OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate(); if (delegate) { mac_plugin_interposing::NotifyPluginOfSetCursor(delegate, cursor); return; 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]; diff --git a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc b/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc index 6131b45..c4ae72d 100644 --- a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc +++ b/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc @@ -14,7 +14,7 @@ CarbonPluginWindowTracker* CarbonPluginWindowTracker::SharedInstance() { } WindowRef CarbonPluginWindowTracker::CreateDummyWindowForDelegate( - WebPluginDelegateImpl* delegate) { + OpaquePluginRef delegate) { // The real size will be set by the plugin instance, once that size is known. Rect window_bounds = { 0, 0, 100, 100 }; WindowRef new_ref = NULL; @@ -28,7 +28,7 @@ WindowRef CarbonPluginWindowTracker::CreateDummyWindowForDelegate( return new_ref; } -WebPluginDelegateImpl* CarbonPluginWindowTracker::GetDelegateForDummyWindow( +OpaquePluginRef CarbonPluginWindowTracker::GetDelegateForDummyWindow( WindowRef window) const { WindowToDelegateMap::const_iterator i = window_to_delegate_map_.find(window); if (i != window_to_delegate_map_.end()) @@ -37,7 +37,7 @@ WebPluginDelegateImpl* CarbonPluginWindowTracker::GetDelegateForDummyWindow( } WindowRef CarbonPluginWindowTracker::GetDummyWindowForDelegate( - WebPluginDelegateImpl* delegate) const { + OpaquePluginRef delegate) const { DelegateToWindowMap::const_iterator i = delegate_to_window_map_.find(delegate); if (i != delegate_to_window_map_.end()) @@ -46,7 +46,7 @@ WindowRef CarbonPluginWindowTracker::GetDummyWindowForDelegate( } void CarbonPluginWindowTracker::DestroyDummyWindowForDelegate( - WebPluginDelegateImpl* delegate, WindowRef window) { + OpaquePluginRef delegate, WindowRef window) { DCHECK(GetDelegateForDummyWindow(window) == delegate); window_to_delegate_map_.erase(window); delegate_to_window_map_.erase(delegate); diff --git a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h b/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h index 3e6ef2d..90fc318 100644 --- a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h +++ b/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h @@ -10,7 +10,9 @@ #include "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; // Creates and tracks the invisible windows that are necessary for // Carbon-event-model plugins. @@ -27,21 +29,21 @@ class __attribute__((visibility("default"))) CarbonPluginWindowTracker { static CarbonPluginWindowTracker* SharedInstance(); // Creates a new carbon window associated with |delegate|. - WindowRef CreateDummyWindowForDelegate(WebPluginDelegateImpl* delegate); + WindowRef CreateDummyWindowForDelegate(OpaquePluginRef delegate); // Returns the WebPluginDelegate associated with the given dummy window. - WebPluginDelegateImpl* GetDelegateForDummyWindow(WindowRef window) const; + OpaquePluginRef GetDelegateForDummyWindow(WindowRef window) const; // Returns the dummy window associated with |delegate|. - WindowRef GetDummyWindowForDelegate(WebPluginDelegateImpl* delegate) const; + WindowRef GetDummyWindowForDelegate(OpaquePluginRef delegate) const; // Destroys the dummy window for |delegate|. - void DestroyDummyWindowForDelegate(WebPluginDelegateImpl* delegate, + void DestroyDummyWindowForDelegate(OpaquePluginRef delegate, WindowRef window); private: - typedef std::map<WindowRef, WebPluginDelegateImpl*> WindowToDelegateMap; - typedef std::map<WebPluginDelegateImpl*, WindowRef> DelegateToWindowMap; + typedef std::map<WindowRef, OpaquePluginRef> WindowToDelegateMap; + typedef std::map<OpaquePluginRef, WindowRef> DelegateToWindowMap; WindowToDelegateMap window_to_delegate_map_; DelegateToWindowMap delegate_to_window_map_; |