| Index: webkit/glue/plugins/webplugin_delegate_impl_mac.mm
|
| diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
|
| similarity index 97%
|
| rename from webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
|
| rename to webkit/glue/plugins/webplugin_delegate_impl_mac.mm
|
| index cf5df05b717717b9abe45b9de929689cf377a7fa..552484ab6b8a734b04b5d11d20980fbb8d15fd93 100644
|
| --- a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
|
| +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
|
| @@ -5,7 +5,7 @@
|
| #import <Cocoa/Cocoa.h>
|
| #import <QuartzCore/QuartzCore.h>
|
|
|
| -#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
|
| +#include "webkit/glue/plugins/webplugin_delegate_impl.h"
|
|
|
| #include <string>
|
| #include <unistd.h>
|
| @@ -19,56 +19,55 @@
|
| #include "base/utf_string_conversions.h"
|
| #include "base/sys_string_conversions.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
|
| +#include "webkit/glue/plugins/plugin_instance.h"
|
| +#include "webkit/glue/plugins/plugin_lib.h"
|
| +#include "webkit/glue/plugins/plugin_list.h"
|
| +#include "webkit/glue/plugins/plugin_stream_url.h"
|
| +#include "webkit/glue/plugins/plugin_web_event_converter_mac.h"
|
| +#include "webkit/glue/plugins/webplugin.h"
|
| +#include "webkit/glue/plugins/webplugin_accelerated_surface_mac.h"
|
| #include "webkit/glue/webkit_glue.h"
|
| -#include "webkit/plugins/npapi/plugin_instance.h"
|
| -#include "webkit/plugins/npapi/plugin_lib.h"
|
| -#include "webkit/plugins/npapi/plugin_list.h"
|
| -#include "webkit/plugins/npapi/plugin_stream_url.h"
|
| -#include "webkit/plugins/npapi/plugin_web_event_converter_mac.h"
|
| -#include "webkit/plugins/npapi/webplugin.h"
|
| -#include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h"
|
|
|
| #ifndef NP_NO_CARBON
|
| -#include "webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h"
|
| +#include "webkit/glue/plugins/carbon_plugin_window_tracker_mac.h"
|
| #endif
|
|
|
| #ifndef NP_NO_QUICKDRAW
|
| -#include "webkit/plugins/npapi/quickdraw_drawing_manager_mac.h"
|
| +#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h"
|
| #endif
|
|
|
| +using webkit_glue::WebPlugin;
|
| +using webkit_glue::WebPluginDelegate;
|
| +using webkit_glue::WebPluginResourceClient;
|
| using WebKit::WebCursorInfo;
|
| using WebKit::WebKeyboardEvent;
|
| using WebKit::WebInputEvent;
|
| using WebKit::WebMouseEvent;
|
| using WebKit::WebMouseWheelEvent;
|
|
|
| +const int kCoreAnimationRedrawPeriodMs = 10; // 100 Hz
|
| +
|
| // Important implementation notes: The Mac definition of NPAPI, particularly
|
| // the distinction between windowed and windowless modes, differs from the
|
| // Windows and Linux definitions. Most of those differences are
|
| // accomodated by the WebPluginDelegate class.
|
|
|
| -namespace webkit {
|
| -namespace npapi {
|
| -
|
| namespace {
|
|
|
| -const int kCoreAnimationRedrawPeriodMs = 10; // 100 Hz
|
| -
|
| WebPluginDelegateImpl* g_active_delegate;
|
|
|
| // Helper to simplify correct usage of g_active_delegate. Instantiating will
|
| // set the active delegate to |delegate| for the lifetime of the object, then
|
| // NULL when it goes out of scope.
|
| class ScopedActiveDelegate {
|
| - public:
|
| +public:
|
| explicit ScopedActiveDelegate(WebPluginDelegateImpl* delegate) {
|
| g_active_delegate = delegate;
|
| }
|
| ~ScopedActiveDelegate() {
|
| g_active_delegate = NULL;
|
| }
|
| -
|
| - private:
|
| +private:
|
| DISALLOW_COPY_AND_ASSIGN(ScopedActiveDelegate);
|
| };
|
|
|
| @@ -249,7 +248,7 @@ int ExternalDragTracker::WebEventButtonModifierMask() {
|
|
|
| WebPluginDelegateImpl::WebPluginDelegateImpl(
|
| gfx::PluginWindowHandle containing_view,
|
| - PluginInstance *instance)
|
| + NPAPI::PluginInstance *instance)
|
| : windowed_handle_(NULL),
|
| // all Mac plugins are "windowless" in the Windows/X11 sense
|
| windowless_(true),
|
| @@ -569,7 +568,7 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
|
| // When an external drag ends, we need to synthesize a MouseEntered.
|
| NPCocoaEvent enter_event = *(static_cast<NPCocoaEvent*>(plugin_event));
|
| enter_event.type = NPCocoaEventMouseEntered;
|
| - ScopedCurrentPluginEvent event_scope(instance(), &enter_event);
|
| + NPAPI::ScopedCurrentPluginEvent event_scope(instance(), &enter_event);
|
| instance()->NPP_HandleEvent(&enter_event);
|
| }
|
| return false;
|
| @@ -577,9 +576,9 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
|
| }
|
|
|
| // Send the plugin the event.
|
| - scoped_ptr<ScopedCurrentPluginEvent> event_scope(NULL);
|
| + scoped_ptr<NPAPI::ScopedCurrentPluginEvent> event_scope(NULL);
|
| if (instance()->event_model() == NPEventModelCocoa) {
|
| - event_scope.reset(new ScopedCurrentPluginEvent(
|
| + event_scope.reset(new NPAPI::ScopedCurrentPluginEvent(
|
| instance(), static_cast<NPCocoaEvent*>(plugin_event)));
|
| }
|
| int16_t handle_response = instance()->NPP_HandleEvent(plugin_event);
|
| @@ -1144,6 +1143,3 @@ void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) {
|
| WindowlessPaint(buffer_context_, clip_rect_);
|
| }
|
| #endif // !NP_NO_QUICKDRAW
|
| -
|
| -} // namespace npapi
|
| -} // namespace webkit
|
|
|