OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_ | |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/weak_ptr.h" | |
12 #include "base/scoped_ptr.h" | |
13 #include "base/task.h" | |
14 #include "gfx/rect.h" | |
15 #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" | |
16 | |
17 namespace WebKit { | |
18 struct WebPluginParams; | |
19 } | |
20 | |
21 namespace pepper { | |
22 | |
23 class PluginDelegate; | |
24 class PluginInstance; | |
25 class PluginModule; | |
26 class URLLoader; | |
27 | |
28 class WebPluginImpl : public WebKit::WebPlugin { | |
29 public: | |
30 WebPluginImpl(PluginModule* module, | |
31 const WebKit::WebPluginParams& params, | |
32 const base::WeakPtr<PluginDelegate>& plugin_delegate); | |
33 | |
34 private: | |
35 friend class DeleteTask<WebPluginImpl>; | |
36 | |
37 ~WebPluginImpl(); | |
38 | |
39 // WebKit::WebPlugin implementation. | |
40 virtual bool initialize(WebKit::WebPluginContainer* container); | |
41 virtual void destroy(); | |
42 virtual NPObject* scriptableObject(); | |
43 virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); | |
44 virtual void updateGeometry( | |
45 const WebKit::WebRect& frame_rect, | |
46 const WebKit::WebRect& clip_rect, | |
47 const WebKit::WebVector<WebKit::WebRect>& cut_outs_rects, | |
48 bool is_visible); | |
49 virtual unsigned getBackingTextureId(); | |
50 virtual void updateFocus(bool focused); | |
51 virtual void updateVisibility(bool visible); | |
52 virtual bool acceptsInputEvents(); | |
53 virtual bool handleInputEvent(const WebKit::WebInputEvent& event, | |
54 WebKit::WebCursorInfo& cursor_info); | |
55 virtual void didReceiveResponse(const WebKit::WebURLResponse& response); | |
56 virtual void didReceiveData(const char* data, int data_length); | |
57 virtual void didFinishLoading(); | |
58 virtual void didFailLoading(const WebKit::WebURLError&); | |
59 virtual void didFinishLoadingFrameRequest(const WebKit::WebURL& url, | |
60 void* notify_data); | |
61 virtual void didFailLoadingFrameRequest(const WebKit::WebURL& url, | |
62 void* notify_data, | |
63 const WebKit::WebURLError& error); | |
64 virtual bool hasSelection() const; | |
65 virtual WebKit::WebString selectionAsText() const; | |
66 virtual WebKit::WebString selectionAsMarkup() const; | |
67 virtual WebKit::WebURL linkAtPosition(const WebKit::WebPoint& position) const; | |
68 virtual void setZoomLevel(double level, bool text_only); | |
69 virtual bool startFind(const WebKit::WebString& search_text, | |
70 bool case_sensitive, | |
71 int identifier); | |
72 virtual void selectFindResult(bool forward); | |
73 virtual void stopFind(); | |
74 virtual bool supportsPaginatedPrint(); | |
75 virtual int printBegin(const WebKit::WebRect& printable_area, | |
76 int printer_dpi); | |
77 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas); | |
78 virtual void printEnd(); | |
79 | |
80 struct InitData; | |
81 | |
82 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. | |
83 // True if the instance represents the entire document in a frame instead of | |
84 // being an embedded resource. | |
85 bool full_frame_; | |
86 scoped_refptr<PluginInstance> instance_; | |
87 scoped_refptr<URLLoader> document_loader_; | |
88 gfx::Rect plugin_rect_; | |
89 | |
90 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | |
91 }; | |
92 | |
93 } // namespace pepper | |
94 | |
95 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_ | |
OLD | NEW |