OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "third_party/WebKit/public/platform/WebCanvas.h" | |
14 #include "third_party/npapi/bindings/npapi.h" | 13 #include "third_party/npapi/bindings/npapi.h" |
15 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
16 #include "webkit/common/cursors/webcursor.h" | 15 #include "webkit/common/cursors/webcursor.h" |
17 | 16 |
18 class GURL; | 17 class GURL; |
| 18 class SkCanvas; |
19 struct NPObject; | 19 struct NPObject; |
20 | 20 |
21 namespace WebKit { | 21 namespace WebKit { |
22 class WebInputEvent; | 22 class WebInputEvent; |
23 } | 23 } |
24 | 24 |
25 namespace gfx { | 25 namespace gfx { |
26 class Rect; | 26 class Rect; |
27 } | 27 } |
28 | 28 |
(...skipping 30 matching lines...) Expand all Loading... |
59 // Update the geometry of the plugin. This is a request to move the | 59 // Update the geometry of the plugin. This is a request to move the |
60 // plugin, relative to its containing window, to the coords given by | 60 // plugin, relative to its containing window, to the coords given by |
61 // window_rect. Its contents should be clipped to the coords given | 61 // window_rect. Its contents should be clipped to the coords given |
62 // by clip_rect, which are relative to the origin of the plugin | 62 // by clip_rect, which are relative to the origin of the plugin |
63 // window. The clip_rect is in plugin-relative coordinates. | 63 // window. The clip_rect is in plugin-relative coordinates. |
64 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 64 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
65 const gfx::Rect& clip_rect) = 0; | 65 const gfx::Rect& clip_rect) = 0; |
66 | 66 |
67 // Tells the plugin to paint the damaged rect. |canvas| is only used for | 67 // Tells the plugin to paint the damaged rect. |canvas| is only used for |
68 // windowless plugins. | 68 // windowless plugins. |
69 virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect) = 0; | 69 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) = 0; |
70 | 70 |
71 // Informs the plugin that it has gained or lost focus. This is only called in | 71 // Informs the plugin that it has gained or lost focus. This is only called in |
72 // windowless mode. | 72 // windowless mode. |
73 virtual void SetFocus(bool focused) = 0; | 73 virtual void SetFocus(bool focused) = 0; |
74 | 74 |
75 // For windowless plugins, gives them a user event like mouse/keyboard. | 75 // For windowless plugins, gives them a user event like mouse/keyboard. |
76 // Returns whether the event was handled. This is only called in windowsless | 76 // Returns whether the event was handled. This is only called in windowsless |
77 // mode. See NPAPI NPP_HandleEvent for more information. | 77 // mode. See NPAPI NPP_HandleEvent for more information. |
78 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, | 78 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, |
79 WebCursor::CursorInfo* cursor) = 0; | 79 WebCursor::CursorInfo* cursor) = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Creates a WebPluginResourceClient instance for an existing stream that is | 128 // Creates a WebPluginResourceClient instance for an existing stream that is |
129 // has become seekable. | 129 // has become seekable. |
130 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 130 virtual WebPluginResourceClient* CreateSeekableResourceClient( |
131 unsigned long resource_id, int range_request_id) = 0; | 131 unsigned long resource_id, int range_request_id) = 0; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace content | 134 } // namespace content |
135 | 135 |
136 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 136 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
OLD | NEW |