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_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 #ifdef __OBJC__ | 34 #ifdef __OBJC__ |
35 @class CALayer; | 35 @class CALayer; |
36 @class CARenderer; | 36 @class CARenderer; |
37 #else | 37 #else |
38 class CALayer; | 38 class CALayer; |
39 class CARenderer; | 39 class CARenderer; |
40 #endif | 40 #endif |
41 #endif | 41 #endif |
42 | 42 |
43 namespace content { | 43 namespace content { |
44 | |
45 class PluginInstance; | 44 class PluginInstance; |
| 45 class PluginURLFetcher; |
| 46 class WebPlugin; |
46 | 47 |
47 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
48 class WebPluginAcceleratedSurface; | 49 class WebPluginAcceleratedSurface; |
49 class ExternalDragTracker; | 50 class ExternalDragTracker; |
50 #endif // OS_MACOSX | 51 #endif // OS_MACOSX |
51 | 52 |
52 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
53 class WebPluginIMEWin; | 54 class WebPluginIMEWin; |
54 #endif // OS_WIN | 55 #endif // OS_WIN |
55 | 56 |
(...skipping 14 matching lines...) Expand all Loading... |
70 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux | 71 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux |
71 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows | 72 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows |
72 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows | 73 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows |
73 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows | 74 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows |
74 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows | 75 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows |
75 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux | 76 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux |
76 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. | 77 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. |
77 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. | 78 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. |
78 }; | 79 }; |
79 | 80 |
80 static WebPluginDelegateImpl* Create(const base::FilePath& filename, | 81 static WebPluginDelegateImpl* Create(WebPlugin* plugin, |
| 82 const base::FilePath& filename, |
81 const std::string& mime_type); | 83 const std::string& mime_type); |
82 | 84 |
83 // WebPluginDelegate implementation | 85 // WebPluginDelegate implementation |
84 virtual bool Initialize(const GURL& url, | 86 virtual bool Initialize(const GURL& url, |
85 const std::vector<std::string>& arg_names, | 87 const std::vector<std::string>& arg_names, |
86 const std::vector<std::string>& arg_values, | 88 const std::vector<std::string>& arg_values, |
87 WebPlugin* plugin, | |
88 bool load_manually) OVERRIDE; | 89 bool load_manually) OVERRIDE; |
89 virtual void PluginDestroyed() OVERRIDE; | 90 virtual void PluginDestroyed() OVERRIDE; |
90 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 91 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
91 const gfx::Rect& clip_rect) OVERRIDE; | 92 const gfx::Rect& clip_rect) OVERRIDE; |
92 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE; | 93 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE; |
93 virtual void SetFocus(bool focused) OVERRIDE; | 94 virtual void SetFocus(bool focused) OVERRIDE; |
94 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, | 95 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, |
95 WebCursor::CursorInfo* cursor_info) OVERRIDE; | 96 WebCursor::CursorInfo* cursor_info) OVERRIDE; |
96 virtual NPObject* GetPluginScriptableObject() OVERRIDE; | 97 virtual NPObject* GetPluginScriptableObject() OVERRIDE; |
97 virtual NPP GetPluginNPP() OVERRIDE; | 98 virtual NPP GetPluginNPP() OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
109 const std::string& headers, | 110 const std::string& headers, |
110 uint32 expected_length, | 111 uint32 expected_length, |
111 uint32 last_modified) OVERRIDE; | 112 uint32 last_modified) OVERRIDE; |
112 virtual void DidReceiveManualData(const char* buffer, int length) OVERRIDE; | 113 virtual void DidReceiveManualData(const char* buffer, int length) OVERRIDE; |
113 virtual void DidFinishManualLoading() OVERRIDE; | 114 virtual void DidFinishManualLoading() OVERRIDE; |
114 virtual void DidManualLoadFail() OVERRIDE; | 115 virtual void DidManualLoadFail() OVERRIDE; |
115 virtual WebPluginResourceClient* CreateResourceClient( | 116 virtual WebPluginResourceClient* CreateResourceClient( |
116 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE; | 117 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE; |
117 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 118 virtual WebPluginResourceClient* CreateSeekableResourceClient( |
118 unsigned long resource_id, int range_request_id) OVERRIDE; | 119 unsigned long resource_id, int range_request_id) OVERRIDE; |
| 120 virtual void FetchURL(unsigned long resource_id, |
| 121 int notify_id, |
| 122 const GURL& url, |
| 123 const GURL& first_party_for_cookies, |
| 124 const std::string& method, |
| 125 const std::string& post_data, |
| 126 const GURL& referrer, |
| 127 bool notify_redirects, |
| 128 bool is_plugin_src_load, |
| 129 int origin_pid, |
| 130 int render_view_id) OVERRIDE; |
119 // End of WebPluginDelegate implementation. | 131 // End of WebPluginDelegate implementation. |
120 | 132 |
121 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; } | 133 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; } |
122 bool IsWindowless() const { return windowless_; } | 134 bool IsWindowless() const { return windowless_; } |
123 PluginInstance* instance() { return instance_.get(); } | 135 PluginInstance* instance() { return instance_.get(); } |
124 gfx::Rect GetRect() const { return window_rect_; } | 136 gfx::Rect GetRect() const { return window_rect_; } |
125 gfx::Rect GetClipRect() const { return clip_rect_; } | 137 gfx::Rect GetClipRect() const { return clip_rect_; } |
126 | 138 |
127 // Returns the path for the library implementing this plugin. | 139 // Returns the path for the library implementing this plugin. |
128 base::FilePath GetPluginPath(); | 140 base::FilePath GetPluginPath(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 #if defined(USE_X11) | 198 #if defined(USE_X11) |
187 void SetWindowlessShmPixmap(XID shm_pixmap) { | 199 void SetWindowlessShmPixmap(XID shm_pixmap) { |
188 windowless_shm_pixmap_ = shm_pixmap; | 200 windowless_shm_pixmap_ = shm_pixmap; |
189 } | 201 } |
190 #endif | 202 #endif |
191 | 203 |
192 private: | 204 private: |
193 friend class base::DeleteHelper<WebPluginDelegateImpl>; | 205 friend class base::DeleteHelper<WebPluginDelegateImpl>; |
194 friend class WebPluginDelegate; | 206 friend class WebPluginDelegate; |
195 | 207 |
196 explicit WebPluginDelegateImpl(PluginInstance* instance); | 208 WebPluginDelegateImpl(WebPlugin* plugin, PluginInstance* instance); |
197 virtual ~WebPluginDelegateImpl(); | 209 virtual ~WebPluginDelegateImpl(); |
198 | 210 |
199 // Called by Initialize() for platform-specific initialization. | 211 // Called by Initialize() for platform-specific initialization. |
200 // If this returns false, the plugin shouldn't be started--see Initialize(). | 212 // If this returns false, the plugin shouldn't be started--see Initialize(). |
201 bool PlatformInitialize(); | 213 bool PlatformInitialize(); |
202 | 214 |
203 // Called by DestroyInstance(), used for platform-specific destruction. | 215 // Called by DestroyInstance(), used for platform-specific destruction. |
204 void PlatformDestroyInstance(); | 216 void PlatformDestroyInstance(); |
205 | 217 |
206 //-------------------------- | 218 //-------------------------- |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 491 |
480 // True if NPP_New did not return an error. | 492 // True if NPP_New did not return an error. |
481 bool creation_succeeded_; | 493 bool creation_succeeded_; |
482 | 494 |
483 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 495 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
484 }; | 496 }; |
485 | 497 |
486 } // namespace content | 498 } // namespace content |
487 | 499 |
488 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 500 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |