Index: webkit/plugins/ppapi/plugin_instance.cc |
=================================================================== |
--- webkit/plugins/ppapi/plugin_instance.cc (revision 0) |
+++ webkit/plugins/ppapi/plugin_instance.cc (working copy) |
@@ -2,21 +2,13 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "webkit/glue/plugins/pepper_plugin_instance.h" |
+#include "webkit/plugins/ppapi/plugin_instance.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
-#if defined(OS_MACOSX) |
-#include "base/mac_util.h" |
-#include "base/mac/scoped_cftyperef.h" |
-#endif |
#include "base/scoped_ptr.h" |
#include "base/utf_string_conversions.h" |
#include "gfx/rect.h" |
-#if defined(OS_WIN) |
-#include "gfx/codec/jpeg_codec.h" |
-#include "gfx/gdi_util.h" |
-#endif |
#include "gfx/skia_util.h" |
#include "ppapi/c/dev/ppb_find_dev.h" |
#include "ppapi/c/dev/ppb_fullscreen_dev.h" |
@@ -47,20 +39,30 @@ |
#include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
-#include "webkit/glue/plugins/pepper_buffer.h" |
-#include "webkit/glue/plugins/pepper_common.h" |
-#include "webkit/glue/plugins/pepper_graphics_2d.h" |
-#include "webkit/glue/plugins/pepper_graphics_3d.h" |
-#include "webkit/glue/plugins/pepper_event_conversion.h" |
-#include "webkit/glue/plugins/pepper_fullscreen_container.h" |
-#include "webkit/glue/plugins/pepper_image_data.h" |
-#include "webkit/glue/plugins/pepper_plugin_delegate.h" |
-#include "webkit/glue/plugins/pepper_plugin_module.h" |
-#include "webkit/glue/plugins/pepper_string.h" |
-#include "webkit/glue/plugins/pepper_url_loader.h" |
-#include "webkit/glue/plugins/pepper_var.h" |
-#include "webkit/glue/plugins/ppp_private.h" |
+#include "webkit/plugins/ppapi/common.h" |
+#include "webkit/plugins/ppapi/event_conversion.h" |
+#include "webkit/plugins/ppapi/fullscreen_container.h" |
+#include "webkit/plugins/ppapi/plugin_delegate.h" |
+#include "webkit/plugins/ppapi/plugin_module.h" |
+#include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
+#include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" |
+#include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
+#include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
+#include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
+#include "webkit/plugins/ppapi/ppp_pdf.h" |
+#include "webkit/plugins/ppapi/string.h" |
+#include "webkit/plugins/ppapi/var.h" |
+#if defined(OS_MACOSX) |
+#include "base/mac_util.h" |
+#include "base/mac/scoped_cftyperef.h" |
+#endif |
+ |
+#if defined(OS_WIN) |
+#include "gfx/codec/jpeg_codec.h" |
+#include "gfx/gdi_util.h" |
+#endif |
+ |
using WebKit::WebBindings; |
using WebKit::WebCanvas; |
using WebKit::WebCursorInfo; |
@@ -72,7 +74,8 @@ |
using WebKit::WebURLRequest; |
using WebKit::WebView; |
-namespace pepper { |
+namespace webkit { |
+namespace ppapi { |
#if defined(OS_WIN) |
// Exported by pdf.dll |
@@ -298,7 +301,7 @@ |
has_content_area_focus_(false), |
find_identifier_(-1), |
plugin_find_interface_(NULL), |
- plugin_private_interface_(NULL), |
+ plugin_pdf_interface_(NULL), |
plugin_selection_interface_(NULL), |
plugin_zoom_interface_(NULL), |
#if defined (OS_LINUX) |
@@ -436,10 +439,10 @@ |
return true; |
} |
- scoped_refptr<Graphics2D> graphics_2d = |
- Resource::GetAs<Graphics2D>(graphics_id); |
- scoped_refptr<Graphics3D> graphics_3d = |
- Resource::GetAs<Graphics3D>(graphics_id); |
+ scoped_refptr<PPB_Graphics2D_Impl> graphics_2d = |
+ Resource::GetAs<PPB_Graphics2D_Impl>(graphics_id); |
+ scoped_refptr<PPB_Graphics3D_Impl> graphics_3d = |
+ Resource::GetAs<PPB_Graphics3D_Impl>(graphics_id); |
if (graphics_2d) { |
if (!graphics_2d->BindToInstance(this)) |
@@ -553,7 +556,7 @@ |
argv.get())); |
} |
-bool PluginInstance::HandleDocumentLoad(URLLoader* loader) { |
+bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) { |
Resource::ScopedResourceId resource(loader); |
return PPBoolToBool(instance_interface_->HandleDocumentLoad(pp_instance(), |
resource.id)); |
@@ -656,7 +659,7 @@ |
// We specifically want to compare against the area covered by the backing |
// store when seeing if we cover the given paint bounds, since the backing |
// store could be smaller than the declared plugin area. |
- ImageData* image_data = bound_graphics_2d()->image_data(); |
+ PPB_ImageData_Impl* image_data = bound_graphics_2d()->image_data(); |
gfx::Rect plugin_backing_store_rect(position_.origin(), |
gfx::Size(image_data->width(), |
image_data->height())); |
@@ -686,13 +689,13 @@ |
} |
string16 PluginInstance::GetLinkAtPosition(const gfx::Point& point) { |
- if (!LoadPrivateInterface()) |
+ if (!LoadPdfInterface()) |
return string16(); |
PP_Point p; |
p.x = point.x(); |
p.y = point.y(); |
- PP_Var rv = plugin_private_interface_->GetLinkAtPosition(pp_instance(), p); |
+ PP_Var rv = plugin_pdf_interface_->GetLinkAtPosition(pp_instance(), p); |
scoped_refptr<StringVar> string(StringVar::FromPPVar(rv)); |
Var::PluginReleasePPVar(rv); // Release the ref the plugin transfered to us. |
if (!string) |
@@ -742,14 +745,14 @@ |
return !!plugin_find_interface_; |
} |
-bool PluginInstance::LoadPrivateInterface() { |
- if (!plugin_private_interface_) { |
- plugin_private_interface_ = |
- reinterpret_cast<const PPP_Private*>(module_->GetPluginInterface( |
- PPP_PRIVATE_INTERFACE)); |
+bool PluginInstance::LoadPdfInterface() { |
+ if (!plugin_pdf_interface_) { |
+ plugin_pdf_interface_ = |
+ reinterpret_cast<const PPP_Pdf*>(module_->GetPluginInterface( |
+ PPP_PDF_INTERFACE)); |
} |
- return !!plugin_private_interface_; |
+ return !!plugin_pdf_interface_; |
} |
bool PluginInstance::LoadSelectionInterface() { |
@@ -939,7 +942,8 @@ |
bool PluginInstance::PrintPDFOutput(PP_Resource print_output, |
WebKit::WebCanvas* canvas) { |
- scoped_refptr<Buffer> buffer(Resource::GetAs<Buffer>(print_output)); |
+ scoped_refptr<PPB_Buffer_Impl> buffer( |
+ Resource::GetAs<PPB_Buffer_Impl>(print_output)); |
if (!buffer.get() || !buffer->is_mapped() || !buffer->size()) { |
NOTREACHED(); |
return false; |
@@ -1023,7 +1027,8 @@ |
bool PluginInstance::PrintRasterOutput(PP_Resource print_output, |
WebKit::WebCanvas* canvas) { |
- scoped_refptr<ImageData> image(Resource::GetAs<ImageData>(print_output)); |
+ scoped_refptr<PPB_ImageData_Impl> image( |
+ Resource::GetAs<PPB_ImageData_Impl>(print_output)); |
if (!image.get() || !image->is_mapped()) |
return false; |
@@ -1162,18 +1167,20 @@ |
} |
#endif // defined(OS_MACOSX) |
-Graphics2D* PluginInstance::bound_graphics_2d() const { |
+PPB_Graphics2D_Impl* PluginInstance::bound_graphics_2d() const { |
if (bound_graphics_.get() == NULL) |
return NULL; |
- return bound_graphics_->Cast<Graphics2D>(); |
+ return bound_graphics_->Cast<PPB_Graphics2D_Impl>(); |
} |
-Graphics3D* PluginInstance::bound_graphics_3d() const { |
+PPB_Graphics3D_Impl* PluginInstance::bound_graphics_3d() const { |
if (bound_graphics_.get() == NULL) |
return NULL; |
- return bound_graphics_->Cast<Graphics3D>(); |
+ return bound_graphics_->Cast<PPB_Graphics3D_Impl>(); |
} |
-} // namespace pepper |
+} // namespace ppapi |
+} // namespace webkit |
+ |