| 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_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
| 14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
| 15 #include "third_party/WebKit/public/web/WebPlugin.h" | 15 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 | 17 |
| 18 struct _NPP; | 18 struct _NPP; |
| 19 | 19 |
| 20 namespace WebKit { | 20 namespace blink { |
| 21 struct WebPluginParams; | 21 struct WebPluginParams; |
| 22 struct WebPrintParams; | 22 struct WebPrintParams; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 class PepperPluginInstanceImpl; | 27 class PepperPluginInstanceImpl; |
| 28 class PluginModule; | 28 class PluginModule; |
| 29 class PPB_URLLoader_Impl; | 29 class PPB_URLLoader_Impl; |
| 30 class RenderViewImpl; | 30 class RenderViewImpl; |
| 31 | 31 |
| 32 class PepperWebPluginImpl : public WebKit::WebPlugin { | 32 class PepperWebPluginImpl : public blink::WebPlugin { |
| 33 public: | 33 public: |
| 34 PepperWebPluginImpl(PluginModule* module, | 34 PepperWebPluginImpl(PluginModule* module, |
| 35 const WebKit::WebPluginParams& params, | 35 const blink::WebPluginParams& params, |
| 36 const base::WeakPtr<RenderViewImpl>& render_view); | 36 const base::WeakPtr<RenderViewImpl>& render_view); |
| 37 | 37 |
| 38 PepperPluginInstanceImpl* instance() { return instance_.get(); } | 38 PepperPluginInstanceImpl* instance() { return instance_.get(); } |
| 39 | 39 |
| 40 // WebKit::WebPlugin implementation. | 40 // blink::WebPlugin implementation. |
| 41 virtual WebKit::WebPluginContainer* container() const; | 41 virtual blink::WebPluginContainer* container() const; |
| 42 virtual bool initialize(WebKit::WebPluginContainer* container); | 42 virtual bool initialize(blink::WebPluginContainer* container); |
| 43 virtual void destroy(); | 43 virtual void destroy(); |
| 44 virtual NPObject* scriptableObject(); | 44 virtual NPObject* scriptableObject(); |
| 45 virtual struct _NPP* pluginNPP(); | 45 virtual struct _NPP* pluginNPP(); |
| 46 virtual bool getFormValue(WebKit::WebString& value); | 46 virtual bool getFormValue(blink::WebString& value); |
| 47 virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); | 47 virtual void paint(blink::WebCanvas* canvas, const blink::WebRect& rect); |
| 48 virtual void updateGeometry( | 48 virtual void updateGeometry( |
| 49 const WebKit::WebRect& frame_rect, | 49 const blink::WebRect& frame_rect, |
| 50 const WebKit::WebRect& clip_rect, | 50 const blink::WebRect& clip_rect, |
| 51 const WebKit::WebVector<WebKit::WebRect>& cut_outs_rects, | 51 const blink::WebVector<blink::WebRect>& cut_outs_rects, |
| 52 bool is_visible); | 52 bool is_visible); |
| 53 virtual void updateFocus(bool focused); | 53 virtual void updateFocus(bool focused); |
| 54 virtual void updateVisibility(bool visible); | 54 virtual void updateVisibility(bool visible); |
| 55 virtual bool acceptsInputEvents(); | 55 virtual bool acceptsInputEvents(); |
| 56 virtual bool handleInputEvent(const WebKit::WebInputEvent& event, | 56 virtual bool handleInputEvent(const blink::WebInputEvent& event, |
| 57 WebKit::WebCursorInfo& cursor_info); | 57 blink::WebCursorInfo& cursor_info); |
| 58 virtual void didReceiveResponse(const WebKit::WebURLResponse& response); | 58 virtual void didReceiveResponse(const blink::WebURLResponse& response); |
| 59 virtual void didReceiveData(const char* data, int data_length); | 59 virtual void didReceiveData(const char* data, int data_length); |
| 60 virtual void didFinishLoading(); | 60 virtual void didFinishLoading(); |
| 61 virtual void didFailLoading(const WebKit::WebURLError&); | 61 virtual void didFailLoading(const blink::WebURLError&); |
| 62 virtual void didFinishLoadingFrameRequest(const WebKit::WebURL& url, | 62 virtual void didFinishLoadingFrameRequest(const blink::WebURL& url, |
| 63 void* notify_data); | 63 void* notify_data); |
| 64 virtual void didFailLoadingFrameRequest(const WebKit::WebURL& url, | 64 virtual void didFailLoadingFrameRequest(const blink::WebURL& url, |
| 65 void* notify_data, | 65 void* notify_data, |
| 66 const WebKit::WebURLError& error); | 66 const blink::WebURLError& error); |
| 67 virtual bool hasSelection() const; | 67 virtual bool hasSelection() const; |
| 68 virtual WebKit::WebString selectionAsText() const; | 68 virtual blink::WebString selectionAsText() const; |
| 69 virtual WebKit::WebString selectionAsMarkup() const; | 69 virtual blink::WebString selectionAsMarkup() const; |
| 70 virtual WebKit::WebURL linkAtPosition(const WebKit::WebPoint& position) const; | 70 virtual blink::WebURL linkAtPosition(const blink::WebPoint& position) const; |
| 71 virtual void setZoomLevel(double level, bool text_only); | 71 virtual void setZoomLevel(double level, bool text_only); |
| 72 virtual bool startFind(const WebKit::WebString& search_text, | 72 virtual bool startFind(const blink::WebString& search_text, |
| 73 bool case_sensitive, | 73 bool case_sensitive, |
| 74 int identifier); | 74 int identifier); |
| 75 virtual void selectFindResult(bool forward); | 75 virtual void selectFindResult(bool forward); |
| 76 virtual void stopFind(); | 76 virtual void stopFind(); |
| 77 virtual bool supportsPaginatedPrint() OVERRIDE; | 77 virtual bool supportsPaginatedPrint() OVERRIDE; |
| 78 virtual bool isPrintScalingDisabled() OVERRIDE; | 78 virtual bool isPrintScalingDisabled() OVERRIDE; |
| 79 | 79 |
| 80 virtual int printBegin(const WebKit::WebPrintParams& print_params) OVERRIDE; | 80 virtual int printBegin(const blink::WebPrintParams& print_params) OVERRIDE; |
| 81 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas) OVERRIDE; | 81 virtual bool printPage(int page_number, blink::WebCanvas* canvas) OVERRIDE; |
| 82 virtual void printEnd() OVERRIDE; | 82 virtual void printEnd() OVERRIDE; |
| 83 | 83 |
| 84 virtual bool canRotateView() OVERRIDE; | 84 virtual bool canRotateView() OVERRIDE; |
| 85 virtual void rotateView(RotationType type) OVERRIDE; | 85 virtual void rotateView(RotationType type) OVERRIDE; |
| 86 virtual bool isPlaceholder() OVERRIDE; | 86 virtual bool isPlaceholder() OVERRIDE; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 friend class base::DeleteHelper<PepperWebPluginImpl>; | 89 friend class base::DeleteHelper<PepperWebPluginImpl>; |
| 90 | 90 |
| 91 virtual ~PepperWebPluginImpl(); | 91 virtual ~PepperWebPluginImpl(); |
| 92 struct InitData; | 92 struct InitData; |
| 93 | 93 |
| 94 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. | 94 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. |
| 95 // True if the instance represents the entire document in a frame instead of | 95 // True if the instance represents the entire document in a frame instead of |
| 96 // being an embedded resource. | 96 // being an embedded resource. |
| 97 bool full_frame_; | 97 bool full_frame_; |
| 98 scoped_refptr<PepperPluginInstanceImpl> instance_; | 98 scoped_refptr<PepperPluginInstanceImpl> instance_; |
| 99 gfx::Rect plugin_rect_; | 99 gfx::Rect plugin_rect_; |
| 100 PP_Var instance_object_; | 100 PP_Var instance_object_; |
| 101 WebKit::WebPluginContainer* container_; | 101 blink::WebPluginContainer* container_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl); | 103 DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace content | 106 } // namespace content |
| 107 | 107 |
| 108 #endif // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 108 #endif // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |