| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. | 71 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. |
| 72 PLUGIN_QUIRK_FAKE_WINDOW_FROM_POINT = 262144, // Windows. | 72 PLUGIN_QUIRK_FAKE_WINDOW_FROM_POINT = 262144, // Windows. |
| 73 PLUGIN_QUIRK_COPY_STREAM_DATA = 524288, // All platforms | 73 PLUGIN_QUIRK_COPY_STREAM_DATA = 524288, // All platforms |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 static WebPluginDelegateImpl* Create(WebPlugin* plugin, | 76 static WebPluginDelegateImpl* Create(WebPlugin* plugin, |
| 77 const base::FilePath& filename, | 77 const base::FilePath& filename, |
| 78 const std::string& mime_type); | 78 const std::string& mime_type); |
| 79 | 79 |
| 80 // WebPluginDelegate implementation | 80 // WebPluginDelegate implementation |
| 81 virtual bool Initialize(const GURL& url, | 81 bool Initialize(const GURL& url, |
| 82 const std::vector<std::string>& arg_names, | 82 const std::vector<std::string>& arg_names, |
| 83 const std::vector<std::string>& arg_values, | 83 const std::vector<std::string>& arg_values, |
| 84 bool load_manually) override; | 84 bool load_manually) override; |
| 85 virtual void PluginDestroyed() override; | 85 void PluginDestroyed() override; |
| 86 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 86 void UpdateGeometry(const gfx::Rect& window_rect, |
| 87 const gfx::Rect& clip_rect) override; | 87 const gfx::Rect& clip_rect) override; |
| 88 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) override; | 88 void Paint(SkCanvas* canvas, const gfx::Rect& rect) override; |
| 89 virtual void SetFocus(bool focused) override; | 89 void SetFocus(bool focused) override; |
| 90 virtual bool HandleInputEvent(const blink::WebInputEvent& event, | 90 bool HandleInputEvent(const blink::WebInputEvent& event, |
| 91 WebCursor::CursorInfo* cursor_info) override; | 91 WebCursor::CursorInfo* cursor_info) override; |
| 92 virtual NPObject* GetPluginScriptableObject() override; | 92 NPObject* GetPluginScriptableObject() override; |
| 93 virtual NPP GetPluginNPP() override; | 93 NPP GetPluginNPP() override; |
| 94 virtual bool GetFormValue(base::string16* value) override; | 94 bool GetFormValue(base::string16* value) override; |
| 95 virtual void DidFinishLoadWithReason(const GURL& url, | 95 void DidFinishLoadWithReason(const GURL& url, |
| 96 NPReason reason, | 96 NPReason reason, |
| 97 int notify_id) override; | 97 int notify_id) override; |
| 98 virtual int GetProcessId() override; | 98 int GetProcessId() override; |
| 99 virtual void SendJavaScriptStream(const GURL& url, | 99 void SendJavaScriptStream(const GURL& url, |
| 100 const std::string& result, | 100 const std::string& result, |
| 101 bool success, | 101 bool success, |
| 102 int notify_id) override; | 102 int notify_id) override; |
| 103 virtual void DidReceiveManualResponse(const GURL& url, | 103 void DidReceiveManualResponse(const GURL& url, |
| 104 const std::string& mime_type, | 104 const std::string& mime_type, |
| 105 const std::string& headers, | 105 const std::string& headers, |
| 106 uint32 expected_length, | 106 uint32 expected_length, |
| 107 uint32 last_modified) override; | 107 uint32 last_modified) override; |
| 108 virtual void DidReceiveManualData(const char* buffer, int length) override; | 108 void DidReceiveManualData(const char* buffer, int length) override; |
| 109 virtual void DidFinishManualLoading() override; | 109 void DidFinishManualLoading() override; |
| 110 virtual void DidManualLoadFail() override; | 110 void DidManualLoadFail() override; |
| 111 virtual WebPluginResourceClient* CreateResourceClient( | 111 WebPluginResourceClient* CreateResourceClient(unsigned long resource_id, |
| 112 unsigned long resource_id, const GURL& url, int notify_id) override; | 112 const GURL& url, |
| 113 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 113 int notify_id) override; |
| 114 unsigned long resource_id, int range_request_id) override; | 114 WebPluginResourceClient* CreateSeekableResourceClient( |
| 115 virtual void FetchURL(unsigned long resource_id, | 115 unsigned long resource_id, |
| 116 int notify_id, | 116 int range_request_id) override; |
| 117 const GURL& url, | 117 void FetchURL(unsigned long resource_id, |
| 118 const GURL& first_party_for_cookies, | 118 int notify_id, |
| 119 const std::string& method, | 119 const GURL& url, |
| 120 const char* buf, | 120 const GURL& first_party_for_cookies, |
| 121 unsigned int len, | 121 const std::string& method, |
| 122 const GURL& referrer, | 122 const char* buf, |
| 123 bool notify_redirects, | 123 unsigned int len, |
| 124 bool is_plugin_src_load, | 124 const GURL& referrer, |
| 125 int origin_pid, | 125 bool notify_redirects, |
| 126 int render_frame_id, | 126 bool is_plugin_src_load, |
| 127 int render_view_id) override; | 127 int origin_pid, |
| 128 int render_frame_id, |
| 129 int render_view_id) override; |
| 128 // End of WebPluginDelegate implementation. | 130 // End of WebPluginDelegate implementation. |
| 129 | 131 |
| 130 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; } | 132 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; } |
| 131 bool IsWindowless() const { return windowless_; } | 133 bool IsWindowless() const { return windowless_; } |
| 132 PluginInstance* instance() { return instance_.get(); } | 134 PluginInstance* instance() { return instance_.get(); } |
| 133 gfx::Rect GetRect() const { return window_rect_; } | 135 gfx::Rect GetRect() const { return window_rect_; } |
| 134 gfx::Rect GetClipRect() const { return clip_rect_; } | 136 gfx::Rect GetClipRect() const { return clip_rect_; } |
| 135 | 137 |
| 136 // Returns the path for the library implementing this plugin. | 138 // Returns the path for the library implementing this plugin. |
| 137 base::FilePath GetPluginPath(); | 139 base::FilePath GetPluginPath(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // port to share code with the Darwin / CG port. Later, this will be removed | 192 // port to share code with the Darwin / CG port. Later, this will be removed |
| 191 // and all callers will use the Paint defined above. | 193 // and all callers will use the Paint defined above. |
| 192 void CGPaint(CGContextRef context, const gfx::Rect& rect); | 194 void CGPaint(CGContextRef context, const gfx::Rect& rect); |
| 193 #endif // OS_MACOSX && !USE_AURA | 195 #endif // OS_MACOSX && !USE_AURA |
| 194 | 196 |
| 195 private: | 197 private: |
| 196 friend class base::DeleteHelper<WebPluginDelegateImpl>; | 198 friend class base::DeleteHelper<WebPluginDelegateImpl>; |
| 197 friend class WebPluginDelegate; | 199 friend class WebPluginDelegate; |
| 198 | 200 |
| 199 WebPluginDelegateImpl(WebPlugin* plugin, PluginInstance* instance); | 201 WebPluginDelegateImpl(WebPlugin* plugin, PluginInstance* instance); |
| 200 virtual ~WebPluginDelegateImpl(); | 202 ~WebPluginDelegateImpl() override; |
| 201 | 203 |
| 202 // Called by Initialize() for platform-specific initialization. | 204 // Called by Initialize() for platform-specific initialization. |
| 203 // If this returns false, the plugin shouldn't be started--see Initialize(). | 205 // If this returns false, the plugin shouldn't be started--see Initialize(). |
| 204 bool PlatformInitialize(); | 206 bool PlatformInitialize(); |
| 205 | 207 |
| 206 // Called by DestroyInstance(), used for platform-specific destruction. | 208 // Called by DestroyInstance(), used for platform-specific destruction. |
| 207 void PlatformDestroyInstance(); | 209 void PlatformDestroyInstance(); |
| 208 | 210 |
| 209 //-------------------------- | 211 //-------------------------- |
| 210 // used for windowed plugins | 212 // used for windowed plugins |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 469 |
| 468 // True if NPP_New did not return an error. | 470 // True if NPP_New did not return an error. |
| 469 bool creation_succeeded_; | 471 bool creation_succeeded_; |
| 470 | 472 |
| 471 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 473 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
| 472 }; | 474 }; |
| 473 | 475 |
| 474 } // namespace content | 476 } // namespace content |
| 475 | 477 |
| 476 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 478 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |