OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ |
6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ | 6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/gfx/native_widget_types.h" | 12 #include "base/gfx/native_widget_types.h" |
12 #include "base/gfx/rect.h" | 13 #include "base/gfx/rect.h" |
13 #include "third_party/npapi/bindings/npapi.h" | 14 #include "third_party/npapi/bindings/npapi.h" |
14 | 15 |
15 typedef struct HDC__* HDC; | 16 typedef struct HDC__* HDC; |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 class WebPlugin; | 19 class WebPlugin; |
(...skipping 16 matching lines...) Expand all Loading... |
35 // the data. This also controls whether the plugin is instantiated as a full | 36 // the data. This also controls whether the plugin is instantiated as a full |
36 // page plugin (NP_FULL) or embedded (NP_EMBED) | 37 // page plugin (NP_FULL) or embedded (NP_EMBED) |
37 virtual bool Initialize(const GURL& url, char** argn, char** argv, | 38 virtual bool Initialize(const GURL& url, char** argn, char** argv, |
38 int argc, WebPlugin* plugin, bool load_manually) = 0; | 39 int argc, WebPlugin* plugin, bool load_manually) = 0; |
39 | 40 |
40 // Called when the WebPlugin is being destroyed. This is a signal to the | 41 // Called when the WebPlugin is being destroyed. This is a signal to the |
41 // delegate that it should tear-down the plugin implementation and not call | 42 // delegate that it should tear-down the plugin implementation and not call |
42 // methods on the WebPlugin again. | 43 // methods on the WebPlugin again. |
43 virtual void PluginDestroyed() = 0; | 44 virtual void PluginDestroyed() = 0; |
44 | 45 |
45 // Update the geometry of the plugin. This is a request to move the plugin, | 46 // Update the geometry of the plugin. This is a request to move the |
46 // relative to its containing window, to the coords given by window_rect. | 47 // plugin, relative to its containing window, to the coords given by |
47 // Its contents should be clipped to the coords given by clip_rect, which are | 48 // window_rect. Its contents should be clipped to the coords given |
48 // relative to the origin of the plugin window. | 49 // by clip_rect, which are relative to the origin of the plugin |
| 50 // window. It's contents should also not overlap the given cutout |
| 51 // rects. The clip_rect and cutout_rects are in plugin-relative |
| 52 // coordinates. |
49 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 53 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
50 const gfx::Rect& clip_rect, bool visible) = 0; | 54 const gfx::Rect& clip_rect, |
| 55 const std::vector<gfx::Rect>& cutout_rects, |
| 56 bool visible) = 0; |
51 | 57 |
52 // Tells the plugin to paint the damaged rect. The HDC is only used for | 58 // Tells the plugin to paint the damaged rect. The HDC is only used for |
53 // windowless plugins. | 59 // windowless plugins. |
54 virtual void Paint(HDC hdc, const gfx::Rect& rect) = 0; | 60 virtual void Paint(HDC hdc, const gfx::Rect& rect) = 0; |
55 | 61 |
56 // Tells the plugin to print itself. | 62 // Tells the plugin to print itself. |
57 virtual void Print(HDC hdc) = 0; | 63 virtual void Print(HDC hdc) = 0; |
58 | 64 |
59 // Informs the plugin that it now has focus. | 65 // Informs the plugin that it now has focus. |
60 virtual void SetFocus() = 0; | 66 virtual void SetFocus() = 0; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void* stream) = 0; | 117 void* stream) = 0; |
112 // Notifies the delegate about a Get/Post URL request getting routed | 118 // Notifies the delegate about a Get/Post URL request getting routed |
113 virtual void URLRequestRouted(const std::string&url, bool notify_needed, | 119 virtual void URLRequestRouted(const std::string&url, bool notify_needed, |
114 void* notify_data) = 0; | 120 void* notify_data) = 0; |
115 private: | 121 private: |
116 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); | 122 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); |
117 }; | 123 }; |
118 | 124 |
119 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ | 125 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ |
120 | 126 |
OLD | NEW |