| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 5 #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 uint32 expected_length, | 67 uint32 expected_length, |
| 68 uint32 last_modified); | 68 uint32 last_modified); |
| 69 virtual void DidReceiveManualData(const char* buffer, int length); | 69 virtual void DidReceiveManualData(const char* buffer, int length); |
| 70 virtual void DidFinishManualLoading(); | 70 virtual void DidFinishManualLoading(); |
| 71 virtual void DidManualLoadFail(); | 71 virtual void DidManualLoadFail(); |
| 72 virtual void InstallMissingPlugin(); | 72 virtual void InstallMissingPlugin(); |
| 73 virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( | 73 virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( |
| 74 unsigned long resource_id, const GURL& url, int notify_id); | 74 unsigned long resource_id, const GURL& url, int notify_id); |
| 75 virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( | 75 virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( |
| 76 unsigned long resource_id, int range_request_id); | 76 unsigned long resource_id, int range_request_id); |
| 77 virtual bool SupportsFind(); |
| 78 virtual void StartFind(const std::string& search_text, |
| 79 bool case_sensitive, |
| 80 int identifier); |
| 81 virtual void SelectFindResult(bool forward); |
| 82 virtual void StopFind(); |
| 83 virtual void NumberOfFindResultsChanged(int total, bool final_result); |
| 84 virtual void SelectedFindResultChanged(int index); |
| 77 | 85 |
| 78 // WebPlugin2DDeviceDelegate implementation. | 86 // WebPlugin2DDeviceDelegate implementation. |
| 79 virtual NPError Device2DQueryCapability(int32 capability, int32* value); | 87 virtual NPError Device2DQueryCapability(int32 capability, int32* value); |
| 80 virtual NPError Device2DQueryConfig(const NPDeviceContext2DConfig* request, | 88 virtual NPError Device2DQueryConfig(const NPDeviceContext2DConfig* request, |
| 81 NPDeviceContext2DConfig* obtain); | 89 NPDeviceContext2DConfig* obtain); |
| 82 virtual NPError Device2DInitializeContext( | 90 virtual NPError Device2DInitializeContext( |
| 83 const NPDeviceContext2DConfig* config, | 91 const NPDeviceContext2DConfig* config, |
| 84 NPDeviceContext2D* context); | 92 NPDeviceContext2D* context); |
| 85 virtual NPError Device2DSetStateContext(NPDeviceContext2D* context, | 93 virtual NPError Device2DSetStateContext(NPDeviceContext2D* context, |
| 86 int32 state, | 94 int32 state, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 NPP id, NPDeviceContextAudio* context, | 150 NPP id, NPDeviceContextAudio* context, |
| 143 NPDeviceFlushContextCallbackPtr callback, void* user_data); | 151 NPDeviceFlushContextCallbackPtr callback, void* user_data); |
| 144 virtual NPError DeviceAudioDestroyContext(NPDeviceContextAudio* context); | 152 virtual NPError DeviceAudioDestroyContext(NPDeviceContextAudio* context); |
| 145 | 153 |
| 146 // WebPluginPrintDelegate implementation. | 154 // WebPluginPrintDelegate implementation. |
| 147 virtual bool PrintSupportsPrintExtension(); | 155 virtual bool PrintSupportsPrintExtension(); |
| 148 virtual int PrintBegin(const gfx::Rect& printable_area, int printer_dpi); | 156 virtual int PrintBegin(const gfx::Rect& printable_area, int printer_dpi); |
| 149 virtual bool PrintPage(int page_number, WebKit::WebCanvas* canvas); | 157 virtual bool PrintPage(int page_number, WebKit::WebCanvas* canvas); |
| 150 virtual void PrintEnd(); | 158 virtual void PrintEnd(); |
| 151 | 159 |
| 152 // End of WebPluginDelegate implementation. | |
| 153 | |
| 154 gfx::Rect GetRect() const { return window_rect_; } | 160 gfx::Rect GetRect() const { return window_rect_; } |
| 155 gfx::Rect GetClipRect() const { return clip_rect_; } | 161 gfx::Rect GetClipRect() const { return clip_rect_; } |
| 156 | 162 |
| 157 // Returns the path for the library implementing this plugin. | 163 // Returns the path for the library implementing this plugin. |
| 158 FilePath GetPluginPath(); | 164 FilePath GetPluginPath(); |
| 159 | 165 |
| 160 // Notifications when the RenderView painted the screen (InitiatedPaint) and | 166 // Notifications when the RenderView painted the screen (InitiatedPaint) and |
| 161 // when an ack was received that the browser copied it to the screen | 167 // when an ack was received that the browser copied it to the screen |
| 162 // (FlushedPaint). | 168 // (FlushedPaint). |
| 163 void RenderViewInitiatedPaint(); | 169 void RenderViewInitiatedPaint(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 181 | 187 |
| 182 void ForwardSetWindow(); | 188 void ForwardSetWindow(); |
| 183 | 189 |
| 184 // A helper method that invokes the plugin's Print extensions to calculate | 190 // A helper method that invokes the plugin's Print extensions to calculate |
| 185 // the size needed in pixels to render the given page in a raster format. | 191 // the size needed in pixels to render the given page in a raster format. |
| 186 bool CalculatePrintedPageDimensions(int page_number, | 192 bool CalculatePrintedPageDimensions(int page_number, |
| 187 NPPPrintExtensions* print_extensions, | 193 NPPPrintExtensions* print_extensions, |
| 188 gfx::Size* page_dimensions); | 194 gfx::Size* page_dimensions); |
| 189 NPPPrintExtensions* GetPrintExtensions(); | 195 NPPPrintExtensions* GetPrintExtensions(); |
| 190 | 196 |
| 197 NPPFindExtensions* GetFindExtensions(); |
| 198 |
| 191 #if defined(OS_WIN) | 199 #if defined(OS_WIN) |
| 192 // Compresses the given bitmap as JPEG and draws it into the backing platform | 200 // Compresses the given bitmap as JPEG and draws it into the backing platform |
| 193 // DC (Windows-only). | 201 // DC (Windows-only). |
| 194 bool DrawJPEGToPlatformDC(const SkBitmap& bitmap, | 202 bool DrawJPEGToPlatformDC(const SkBitmap& bitmap, |
| 195 const gfx::Rect& printable_area, | 203 const gfx::Rect& printable_area, |
| 196 WebKit::WebCanvas* canvas); | 204 WebKit::WebCanvas* canvas); |
| 197 #endif // OS_WIN | 205 #endif // OS_WIN |
| 198 | 206 |
| 199 #if defined(ENABLE_GPU) | 207 #if defined(ENABLE_GPU) |
| 200 | 208 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // The last printable_area passed in to PrintBegin. We remember this because | 247 // The last printable_area passed in to PrintBegin. We remember this because |
| 240 // we need to stretch the printed raster bitmap to these dimensions. It is | 248 // we need to stretch the printed raster bitmap to these dimensions. It is |
| 241 // cleared in PrintEnd. | 249 // cleared in PrintEnd. |
| 242 gfx::Rect current_printable_area_; | 250 gfx::Rect current_printable_area_; |
| 243 | 251 |
| 244 #if defined(ENABLE_GPU) | 252 #if defined(ENABLE_GPU) |
| 245 // The command buffer used to issue commands to the nested GPU plugin. | 253 // The command buffer used to issue commands to the nested GPU plugin. |
| 246 CommandBufferProxy* command_buffer_; | 254 CommandBufferProxy* command_buffer_; |
| 247 #endif | 255 #endif |
| 248 | 256 |
| 257 // The id of the current find operation, or -1 if none is in process. |
| 258 int find_identifier_; |
| 259 |
| 249 // Tells the browser out-of-band where the nested delegate lives on | 260 // Tells the browser out-of-band where the nested delegate lives on |
| 250 // the page. | 261 // the page. |
| 251 void SendNestedDelegateGeometryToBrowser(const gfx::Rect& window_rect, | 262 void SendNestedDelegateGeometryToBrowser(const gfx::Rect& window_rect, |
| 252 const gfx::Rect& clip_rect); | 263 const gfx::Rect& clip_rect); |
| 253 | 264 |
| 254 // Runnable methods that must be cancelled when the 3D context is destroyed. | 265 // Runnable methods that must be cancelled when the 3D context is destroyed. |
| 255 ScopedRunnableMethodFactory<WebPluginDelegatePepper> method_factory3d_; | 266 ScopedRunnableMethodFactory<WebPluginDelegatePepper> method_factory3d_; |
| 256 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); | 267 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); |
| 257 }; | 268 }; |
| 258 | 269 |
| 259 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 270 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| OLD | NEW |