| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
| 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <map> | 11 #include <map> |
| 9 #include <string> | 12 #include <string> |
| 10 #include <vector> | 13 #include <vector> |
| 11 | 14 |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "build/build_config.h" |
| 16 #include "content/child/npapi/webplugin.h" | 20 #include "content/child/npapi/webplugin.h" |
| 17 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 18 #include "content/common/webplugin_geometry.h" | 22 #include "content/common/webplugin_geometry.h" |
| 19 #include "third_party/WebKit/public/platform/WebRect.h" | 23 #include "third_party/WebKit/public/platform/WebRect.h" |
| 20 #include "third_party/WebKit/public/platform/WebString.h" | 24 #include "third_party/WebKit/public/platform/WebString.h" |
| 21 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 25 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
| 22 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 26 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 23 #include "third_party/WebKit/public/platform/WebVector.h" | 27 #include "third_party/WebKit/public/platform/WebVector.h" |
| 24 #include "third_party/WebKit/public/web/WebPlugin.h" | 28 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 blink::WebFrame* frame, | 59 blink::WebFrame* frame, |
| 56 const blink::WebPluginParams& params, | 60 const blink::WebPluginParams& params, |
| 57 const base::FilePath& file_path, | 61 const base::FilePath& file_path, |
| 58 const base::WeakPtr<RenderViewImpl>& render_view, | 62 const base::WeakPtr<RenderViewImpl>& render_view, |
| 59 RenderFrameImpl* render_frame); | 63 RenderFrameImpl* render_frame); |
| 60 ~WebPluginImpl() override; | 64 ~WebPluginImpl() override; |
| 61 | 65 |
| 62 // Helper function for sorting post data. | 66 // Helper function for sorting post data. |
| 63 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, | 67 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, |
| 64 const char* buf, | 68 const char* buf, |
| 65 uint32 length); | 69 uint32_t length); |
| 66 | 70 |
| 67 blink::WebFrame* webframe() { return webframe_; } | 71 blink::WebFrame* webframe() { return webframe_; } |
| 68 | 72 |
| 69 // blink::WebPlugin methods: | 73 // blink::WebPlugin methods: |
| 70 bool initialize(blink::WebPluginContainer* container) override; | 74 bool initialize(blink::WebPluginContainer* container) override; |
| 71 void destroy() override; | 75 void destroy() override; |
| 72 NPObject* scriptableObject() override; | 76 NPObject* scriptableObject() override; |
| 73 struct _NPP* pluginNPP() override; | 77 struct _NPP* pluginNPP() override; |
| 74 bool getFormValue(blink::WebString& value) override; | 78 bool getFormValue(blink::WebString& value) override; |
| 75 void layoutIfNeeded() override; | 79 void layoutIfNeeded() override; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 118 void SetWindowlessData(HANDLE pump_messages_event, | 122 void SetWindowlessData(HANDLE pump_messages_event, |
| 119 gfx::NativeViewId dummy_activation_window) override {} | 123 gfx::NativeViewId dummy_activation_window) override {} |
| 120 void ReparentPluginWindow(HWND window, HWND parent) { } | 124 void ReparentPluginWindow(HWND window, HWND parent) { } |
| 121 void ReportExecutableMemory(size_t size) { } | 125 void ReportExecutableMemory(size_t size) { } |
| 122 #endif | 126 #endif |
| 123 #if defined(OS_MACOSX) | 127 #if defined(OS_MACOSX) |
| 124 WebPluginAcceleratedSurface* GetAcceleratedSurface( | 128 WebPluginAcceleratedSurface* GetAcceleratedSurface( |
| 125 gfx::GpuPreference gpu_preference) override; | 129 gfx::GpuPreference gpu_preference) override; |
| 126 void AcceleratedPluginEnabledRendering() override; | 130 void AcceleratedPluginEnabledRendering() override; |
| 127 void AcceleratedPluginAllocatedIOSurface(int32 width, | 131 void AcceleratedPluginAllocatedIOSurface(int32_t width, |
| 128 int32 height, | 132 int32_t height, |
| 129 uint32 surface_id) override; | 133 uint32_t surface_id) override; |
| 130 void AcceleratedPluginSwappedIOSurface() override; | 134 void AcceleratedPluginSwappedIOSurface() override; |
| 131 #endif | 135 #endif |
| 132 | 136 |
| 133 private: | 137 private: |
| 134 // Given a (maybe partial) url, completes using the base url. | 138 // Given a (maybe partial) url, completes using the base url. |
| 135 GURL CompleteURL(const char* url); | 139 GURL CompleteURL(const char* url); |
| 136 | 140 |
| 137 enum RoutingStatus { | 141 enum RoutingStatus { |
| 138 ROUTED, | 142 ROUTED, |
| 139 NOT_ROUTED, | 143 NOT_ROUTED, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 228 |
| 225 // Check for invalid chars like @, ;, \ before the first / (in path). | 229 // Check for invalid chars like @, ;, \ before the first / (in path). |
| 226 bool IsValidUrl(const GURL& url, ReferrerValue referrer_flag); | 230 bool IsValidUrl(const GURL& url, ReferrerValue referrer_flag); |
| 227 | 231 |
| 228 std::vector<ClientInfo> clients_; | 232 std::vector<ClientInfo> clients_; |
| 229 | 233 |
| 230 bool windowless_; | 234 bool windowless_; |
| 231 gfx::PluginWindowHandle window_; | 235 gfx::PluginWindowHandle window_; |
| 232 #if defined(OS_MACOSX) | 236 #if defined(OS_MACOSX) |
| 233 bool next_io_surface_allocated_; | 237 bool next_io_surface_allocated_; |
| 234 int32 next_io_surface_width_; | 238 int32_t next_io_surface_width_; |
| 235 int32 next_io_surface_height_; | 239 int32_t next_io_surface_height_; |
| 236 uint32 next_io_surface_id_; | 240 uint32_t next_io_surface_id_; |
| 237 scoped_refptr<cc::IOSurfaceLayer> io_surface_layer_; | 241 scoped_refptr<cc::IOSurfaceLayer> io_surface_layer_; |
| 238 scoped_ptr<blink::WebLayer> web_layer_; | 242 scoped_ptr<blink::WebLayer> web_layer_; |
| 239 #endif | 243 #endif |
| 240 bool accepts_input_events_; | 244 bool accepts_input_events_; |
| 241 RenderFrameImpl* render_frame_; | 245 RenderFrameImpl* render_frame_; |
| 242 base::WeakPtr<RenderViewImpl> render_view_; | 246 base::WeakPtr<RenderViewImpl> render_view_; |
| 243 blink::WebFrame* webframe_; | 247 blink::WebFrame* webframe_; |
| 244 | 248 |
| 245 WebPluginDelegateProxy* delegate_; | 249 WebPluginDelegateProxy* delegate_; |
| 246 | 250 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 }; | 318 }; |
| 315 | 319 |
| 316 LoaderClient loader_client_; | 320 LoaderClient loader_client_; |
| 317 | 321 |
| 318 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 322 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 319 }; | 323 }; |
| 320 | 324 |
| 321 } // namespace content | 325 } // namespace content |
| 322 | 326 |
| 323 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 327 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |