Index: webkit/plugins/npapi/webplugin_delegate_impl_mac.mm |
=================================================================== |
--- webkit/plugins/npapi/webplugin_delegate_impl_mac.mm (revision 0) |
+++ webkit/plugins/npapi/webplugin_delegate_impl_mac.mm (working copy) |
@@ -5,7 +5,7 @@ |
#import <Cocoa/Cocoa.h> |
#import <QuartzCore/QuartzCore.h> |
-#include "webkit/glue/plugins/webplugin_delegate_impl.h" |
+#include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
#include <string> |
#include <unistd.h> |
@@ -19,55 +19,56 @@ |
#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/glue/plugins/carbon_plugin_window_tracker_mac.h" |
+#include "webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h" |
#endif |
#ifndef NP_NO_QUICKDRAW |
-#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h" |
+#include "webkit/plugins/npapi/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); |
}; |
@@ -248,7 +249,7 @@ |
WebPluginDelegateImpl::WebPluginDelegateImpl( |
gfx::PluginWindowHandle containing_view, |
- NPAPI::PluginInstance *instance) |
+ PluginInstance *instance) |
: windowed_handle_(NULL), |
// all Mac plugins are "windowless" in the Windows/X11 sense |
windowless_(true), |
@@ -568,7 +569,7 @@ |
// When an external drag ends, we need to synthesize a MouseEntered. |
NPCocoaEvent enter_event = *(static_cast<NPCocoaEvent*>(plugin_event)); |
enter_event.type = NPCocoaEventMouseEntered; |
- NPAPI::ScopedCurrentPluginEvent event_scope(instance(), &enter_event); |
+ ScopedCurrentPluginEvent event_scope(instance(), &enter_event); |
instance()->NPP_HandleEvent(&enter_event); |
} |
return false; |
@@ -576,9 +577,9 @@ |
} |
// Send the plugin the event. |
- scoped_ptr<NPAPI::ScopedCurrentPluginEvent> event_scope(NULL); |
+ scoped_ptr<ScopedCurrentPluginEvent> event_scope(NULL); |
if (instance()->event_model() == NPEventModelCocoa) { |
- event_scope.reset(new NPAPI::ScopedCurrentPluginEvent( |
+ event_scope.reset(new ScopedCurrentPluginEvent( |
instance(), static_cast<NPCocoaEvent*>(plugin_event))); |
} |
int16_t handle_response = instance()->NPP_HandleEvent(plugin_event); |
@@ -1143,3 +1144,6 @@ |
WindowlessPaint(buffer_context_, clip_rect_); |
} |
#endif // !NP_NO_QUICKDRAW |
+ |
+} // namespace npapi |
+} // namespace webkit |