| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "app/gfx/native_widget_types.h" | 14 #include "app/gfx/native_widget_types.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/linked_ptr.h" | 16 #include "base/linked_ptr.h" |
| 17 #include "base/gfx/rect.h" | 17 #include "base/gfx/rect.h" |
| 18 #include "base/ref_counted.h" | 18 #include "base/ref_counted.h" |
| 19 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 20 #include "base/task.h" | 20 #include "base/task.h" |
| 21 #include "chrome/common/transport_dib.h" | 21 #include "chrome/common/transport_dib.h" |
| 22 #include "skia/ext/platform_canvas.h" | 22 #include "skia/ext/platform_canvas.h" |
| 23 #include "third_party/npapi/bindings/npapi.h" | 23 #include "third_party/npapi/bindings/npapi.h" |
| 24 #include "webkit/glue/pepper/pepper.h" | 24 #include "third_party/npapi/bindings/npapi_extensions.h" |
| 25 #include "webkit/glue/webcursor.h" | 25 #include "webkit/glue/webcursor.h" |
| 26 #include "webkit/glue/webplugin_delegate.h" | 26 #include "webkit/glue/webplugin_delegate.h" |
| 27 | 27 |
| 28 namespace NPAPI { | 28 namespace NPAPI { |
| 29 class PluginInstance; | 29 class PluginInstance; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // An implementation of WebPluginDelegate for Pepper in-process plugins. | 32 // An implementation of WebPluginDelegate for Pepper in-process plugins. |
| 33 class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate { | 33 class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate { |
| 34 public: | 34 public: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 virtual void DidReceiveManualData(const char* buffer, int length); | 73 virtual void DidReceiveManualData(const char* buffer, int length); |
| 74 virtual void DidFinishManualLoading(); | 74 virtual void DidFinishManualLoading(); |
| 75 virtual void DidManualLoadFail(); | 75 virtual void DidManualLoadFail(); |
| 76 virtual void InstallMissingPlugin(); | 76 virtual void InstallMissingPlugin(); |
| 77 virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( | 77 virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( |
| 78 int resource_id, | 78 int resource_id, |
| 79 const GURL& url, | 79 const GURL& url, |
| 80 bool notify_needed, | 80 bool notify_needed, |
| 81 intptr_t notify_data, | 81 intptr_t notify_data, |
| 82 intptr_t stream); | 82 intptr_t stream); |
| 83 virtual NPError Device2DQueryCapability(int32 capability, int32* value); |
| 84 virtual NPError Device2DQueryConfig(const NPDeviceContext2DConfig* request, |
| 85 NPDeviceContext2DConfig* obtain); |
| 86 virtual NPError Device2DInitializeContext( |
| 87 const NPDeviceContext2DConfig* config, |
| 88 NPDeviceContext2D* context); |
| 89 virtual NPError Device2DSetStateContext(NPDeviceContext2D* context, |
| 90 int32 state, |
| 91 int32 value); |
| 92 virtual NPError Device2DGetStateContext(NPDeviceContext2D* context, |
| 93 int32 state, |
| 94 int32* value); |
| 95 virtual NPError Device2DFlushContext(NPDeviceContext2D* context, |
| 96 NPDeviceFlushContextCallbackPtr callback, |
| 97 void* user_data); |
| 98 virtual NPError Device2DDestroyContext(NPDeviceContext2D* context); |
| 83 // End of WebPluginDelegate implementation. | 99 // End of WebPluginDelegate implementation. |
| 84 | 100 |
| 85 bool IsWindowless() const { return true; } | 101 bool IsWindowless() const { return true; } |
| 86 gfx::Rect GetRect() const { return window_rect_; } | 102 gfx::Rect GetRect() const { return window_rect_; } |
| 87 gfx::Rect GetClipRect() const { return clip_rect_; } | 103 gfx::Rect GetClipRect() const { return clip_rect_; } |
| 88 | 104 |
| 89 // Returns the path for the library implementing this plugin. | 105 // Returns the path for the library implementing this plugin. |
| 90 FilePath GetPluginPath(); | 106 FilePath GetPluginPath(); |
| 91 | 107 |
| 92 private: | 108 private: |
| 93 WebPluginDelegatePepper(gfx::PluginWindowHandle containing_view, | 109 WebPluginDelegatePepper(gfx::PluginWindowHandle containing_view, |
| 94 NPAPI::PluginInstance *instance); | 110 NPAPI::PluginInstance *instance); |
| 95 ~WebPluginDelegatePepper(); | 111 ~WebPluginDelegatePepper(); |
| 96 | 112 |
| 97 //---------------------------- | |
| 98 // used for windowless plugins | |
| 99 virtual NPError InitializeRenderContext(NPRenderType type, | |
| 100 NPRenderContext* context); | |
| 101 virtual NPError DestroyRenderContext(NPRenderContext* context); | |
| 102 virtual NPError FlushRenderContext(NPRenderContext* context); | |
| 103 | |
| 104 virtual NPError OpenFileInSandbox(const char* file_name, void** handle); | |
| 105 | |
| 106 // Tells the plugin about the current state of the window. | 113 // Tells the plugin about the current state of the window. |
| 107 // See NPAPI NPP_SetWindow for more information. | 114 // See NPAPI NPP_SetWindow for more information. |
| 108 void WindowlessSetWindow(bool force_set_window); | 115 void WindowlessSetWindow(bool force_set_window); |
| 109 | 116 |
| 110 //----------------------------------------- | 117 //----------------------------------------- |
| 111 // used for windowed and windowless plugins | 118 // used for windowed and windowless plugins |
| 112 | 119 |
| 113 NPAPI::PluginInstance* instance() { return instance_.get(); } | 120 NPAPI::PluginInstance* instance() { return instance_.get(); } |
| 114 | 121 |
| 115 // Closes down and destroys our plugin instance. | 122 // Closes down and destroys our plugin instance. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 144 typedef std::map< void*, linked_ptr<OpenPaintContext> > OpenPaintContextMap; | 151 typedef std::map< void*, linked_ptr<OpenPaintContext> > OpenPaintContextMap; |
| 145 OpenPaintContextMap open_paint_contexts_; | 152 OpenPaintContextMap open_paint_contexts_; |
| 146 | 153 |
| 147 // The url with which the plugin was instantiated. | 154 // The url with which the plugin was instantiated. |
| 148 std::string plugin_url_; | 155 std::string plugin_url_; |
| 149 | 156 |
| 150 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); | 157 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); |
| 151 }; | 158 }; |
| 152 | 159 |
| 153 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 160 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| OLD | NEW |