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 CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ | 5 #ifndef CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ |
6 #define CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ | 6 #define CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "base/scoped_handle.h" | 10 #include "base/scoped_handle.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
13 #include "base/timer.h" | 13 #include "base/timer.h" |
14 #include "chrome/common/ipc_message.h" | 14 #include "chrome/common/ipc_message.h" |
15 #include "chrome/common/chrome_plugin_api.h" | 15 #include "chrome/common/chrome_plugin_api.h" |
16 #include "webkit/glue/webplugin.h" | 16 #include "webkit/glue/webplugin.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class WaitableEvent; | 19 class WaitableEvent; |
20 } | 20 } |
21 | 21 |
22 class PluginChannel; | 22 class PluginChannel; |
23 class WebPluginDelegateImpl; | 23 class WebPluginDelegate; |
24 | 24 |
25 // This is an implementation of WebPlugin that proxies all calls to the | 25 // This is an implementation of WebPlugin that proxies all calls to the |
26 // renderer. | 26 // renderer. |
27 class WebPluginProxy : public WebPlugin { | 27 class WebPluginProxy : public WebPlugin { |
28 public: | 28 public: |
29 // Creates a new proxy for WebPlugin, using the given sender to send the | 29 // Creates a new proxy for WebPlugin, using the given sender to send the |
30 // marshalled WebPlugin calls. | 30 // marshalled WebPlugin calls. |
31 WebPluginProxy(PluginChannel* channel, | 31 WebPluginProxy(PluginChannel* channel, |
32 int route_id, | 32 int route_id, |
33 WebPluginDelegateImpl* delegate, | 33 WebPluginDelegate* delegate, |
34 HANDLE modal_dialog_event); | 34 HANDLE modal_dialog_event); |
35 ~WebPluginProxy(); | 35 ~WebPluginProxy(); |
36 | 36 |
37 // WebPlugin overrides | 37 // WebPlugin overrides |
38 void SetWindow(HWND window, HANDLE pump_messages_event); | 38 void SetWindow(HWND window, HANDLE pump_messages_event); |
39 void CancelResource(int id); | 39 void CancelResource(int id); |
40 void Invalidate(); | 40 void Invalidate(); |
41 void InvalidateRect(const gfx::Rect& rect); | 41 void InvalidateRect(const gfx::Rect& rect); |
42 NPObject* GetWindowScriptNPObject(); | 42 NPObject* GetWindowScriptNPObject(); |
43 NPObject* GetPluginElement(); | 43 NPObject* GetPluginElement(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // transform of the local HDC. | 118 // transform of the local HDC. |
119 void UpdateTransform(); | 119 void UpdateTransform(); |
120 | 120 |
121 typedef base::hash_map<int, WebPluginResourceClient*> ResourceClientMap; | 121 typedef base::hash_map<int, WebPluginResourceClient*> ResourceClientMap; |
122 ResourceClientMap resource_clients_; | 122 ResourceClientMap resource_clients_; |
123 | 123 |
124 scoped_refptr<PluginChannel> channel_; | 124 scoped_refptr<PluginChannel> channel_; |
125 int route_id_; | 125 int route_id_; |
126 NPObject* window_npobject_; | 126 NPObject* window_npobject_; |
127 NPObject* plugin_element_; | 127 NPObject* plugin_element_; |
128 WebPluginDelegateImpl* delegate_; | 128 WebPluginDelegate* delegate_; |
129 gfx::Rect damaged_rect_; | 129 gfx::Rect damaged_rect_; |
130 bool waiting_for_paint_; | 130 bool waiting_for_paint_; |
131 uint32 cp_browsing_context_; | 131 uint32 cp_browsing_context_; |
132 scoped_ptr<base::WaitableEvent> modal_dialog_event_; | 132 scoped_ptr<base::WaitableEvent> modal_dialog_event_; |
133 HWND parent_window_; | 133 HWND parent_window_; |
134 | 134 |
135 // Variables used for desynchronized windowless plugin painting. See note in | 135 // Variables used for desynchronized windowless plugin painting. See note in |
136 // webplugin_delegate_proxy.h for how this works. | 136 // webplugin_delegate_proxy.h for how this works. |
137 | 137 |
138 // These hold the bitmap where the plugin draws. | 138 // These hold the bitmap where the plugin draws. |
139 ScopedHandle windowless_shared_section_; | 139 ScopedHandle windowless_shared_section_; |
140 ScopedBitmap windowless_bitmap_; | 140 ScopedBitmap windowless_bitmap_; |
141 ScopedHDC windowless_hdc_; | 141 ScopedHDC windowless_hdc_; |
142 | 142 |
143 // These hold the bitmap of the background image. | 143 // These hold the bitmap of the background image. |
144 ScopedHandle background_shared_section_; | 144 ScopedHandle background_shared_section_; |
145 ScopedBitmap background_bitmap_; | 145 ScopedBitmap background_bitmap_; |
146 ScopedHDC background_hdc_; | 146 ScopedHDC background_hdc_; |
147 | 147 |
148 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; | 148 ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; |
149 }; | 149 }; |
150 | 150 |
151 #endif // CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ | 151 #endif // CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ |
OLD | NEW |