OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #endif | 28 #endif |
29 | 29 |
30 struct NPObject; | 30 struct NPObject; |
31 struct PluginHostMsg_URLRequest_Params; | 31 struct PluginHostMsg_URLRequest_Params; |
32 class SkBitmap; | 32 class SkBitmap; |
33 | 33 |
34 namespace base { | 34 namespace base { |
35 class WaitableEvent; | 35 class WaitableEvent; |
36 } | 36 } |
37 | 37 |
38 namespace skia { | |
39 class PlatformCanvas; | |
40 } | |
41 | |
42 namespace webkit { | 38 namespace webkit { |
43 namespace npapi { | 39 namespace npapi { |
44 class WebPlugin; | 40 class WebPlugin; |
45 } | 41 } |
46 } | 42 } |
47 | 43 |
48 namespace content { | 44 namespace content { |
49 class NPObjectStub; | 45 class NPObjectStub; |
50 class PluginChannelHost; | 46 class PluginChannelHost; |
51 class RenderViewImpl; | 47 class RenderViewImpl; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 protected: | 133 protected: |
138 friend class base::DeleteHelper<WebPluginDelegateProxy>; | 134 friend class base::DeleteHelper<WebPluginDelegateProxy>; |
139 virtual ~WebPluginDelegateProxy(); | 135 virtual ~WebPluginDelegateProxy(); |
140 | 136 |
141 private: | 137 private: |
142 struct SharedBitmap { | 138 struct SharedBitmap { |
143 SharedBitmap(); | 139 SharedBitmap(); |
144 ~SharedBitmap(); | 140 ~SharedBitmap(); |
145 | 141 |
146 scoped_ptr<TransportDIB> dib; | 142 scoped_ptr<TransportDIB> dib; |
147 scoped_ptr<skia::PlatformCanvas> canvas; | 143 scoped_ptr<SkCanvas> canvas; |
148 }; | 144 }; |
149 | 145 |
150 // Message handlers for messages that proxy WebPlugin methods, which | 146 // Message handlers for messages that proxy WebPlugin methods, which |
151 // we translate into calls to the real WebPlugin. | 147 // we translate into calls to the real WebPlugin. |
152 void OnSetWindow(gfx::PluginWindowHandle window); | 148 void OnSetWindow(gfx::PluginWindowHandle window); |
153 #if defined(OS_WIN) | 149 #if defined(OS_WIN) |
154 void OnSetWindowlessData(HANDLE modal_loop_pump_messages_event, | 150 void OnSetWindowlessData(HANDLE modal_loop_pump_messages_event, |
155 gfx::NativeViewId dummy_activation_window); | 151 gfx::NativeViewId dummy_activation_window); |
156 void OnNotifyIMEStatus(const int input_mode, const gfx::Rect& caret_rect); | 152 void OnNotifyIMEStatus(const int input_mode, const gfx::Rect& caret_rect); |
157 #endif | 153 #endif |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void ResetWindowlessBitmaps(); | 216 void ResetWindowlessBitmaps(); |
221 | 217 |
222 int front_buffer_index() const { | 218 int front_buffer_index() const { |
223 return front_buffer_index_; | 219 return front_buffer_index_; |
224 } | 220 } |
225 | 221 |
226 int back_buffer_index() const { | 222 int back_buffer_index() const { |
227 return 1 - front_buffer_index_; | 223 return 1 - front_buffer_index_; |
228 } | 224 } |
229 | 225 |
230 skia::PlatformCanvas* front_buffer_canvas() const { | 226 SkCanvas* front_buffer_canvas() const { |
231 return transport_stores_[front_buffer_index()].canvas.get(); | 227 return transport_stores_[front_buffer_index()].canvas.get(); |
232 } | 228 } |
233 | 229 |
234 skia::PlatformCanvas* back_buffer_canvas() const { | 230 SkCanvas* back_buffer_canvas() const { |
235 return transport_stores_[back_buffer_index()].canvas.get(); | 231 return transport_stores_[back_buffer_index()].canvas.get(); |
236 } | 232 } |
237 | 233 |
238 TransportDIB* front_buffer_dib() const { | 234 TransportDIB* front_buffer_dib() const { |
239 return transport_stores_[front_buffer_index()].dib.get(); | 235 return transport_stores_[front_buffer_index()].dib.get(); |
240 } | 236 } |
241 | 237 |
242 TransportDIB* back_buffer_dib() const { | 238 TransportDIB* back_buffer_dib() const { |
243 return transport_stores_[back_buffer_index()].dib.get(); | 239 return transport_stores_[back_buffer_index()].dib.get(); |
244 } | 240 } |
245 | 241 |
246 #if !defined(OS_WIN) | 242 #if !defined(OS_WIN) |
247 // Creates a process-local memory section and canvas. PlatformCanvas on | 243 // Creates a process-local memory section and canvas. PlatformCanvas on |
248 // Windows only works with a DIB, not arbitrary memory. | 244 // Windows only works with a DIB, not arbitrary memory. |
249 bool CreateLocalBitmap(std::vector<uint8>* memory, | 245 bool CreateLocalBitmap(std::vector<uint8>* memory, |
250 scoped_ptr<skia::PlatformCanvas>* canvas); | 246 scoped_ptr<SkCanvas>* canvas); |
251 #endif | 247 #endif |
252 | 248 |
253 // Creates a shared memory section and canvas. | 249 // Creates a shared memory section and canvas. |
254 bool CreateSharedBitmap(scoped_ptr<TransportDIB>* memory, | 250 bool CreateSharedBitmap(scoped_ptr<TransportDIB>* memory, |
255 scoped_ptr<skia::PlatformCanvas>* canvas); | 251 scoped_ptr<SkCanvas>* canvas); |
256 | 252 |
257 // Called for cleanup during plugin destruction. Normally right before the | 253 // Called for cleanup during plugin destruction. Normally right before the |
258 // plugin window gets destroyed, or when the plugin has crashed (at which | 254 // plugin window gets destroyed, or when the plugin has crashed (at which |
259 // point the window has already been destroyed). | 255 // point the window has already been destroyed). |
260 void WillDestroyWindow(); | 256 void WillDestroyWindow(); |
261 | 257 |
262 #if defined(OS_MACOSX) | 258 #if defined(OS_MACOSX) |
263 // Synthesize a fake window handle for the plug-in to identify the instance | 259 // Synthesize a fake window handle for the plug-in to identify the instance |
264 // to the browser, allowing mapping to a surface for hardware acceleration | 260 // to the browser, allowing mapping to a surface for hardware acceleration |
265 // of plug-in content. The browser generates the handle which is then set on | 261 // of plug-in content. The browser generates the handle which is then set on |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 314 |
319 // The url of the main frame hosting the plugin. | 315 // The url of the main frame hosting the plugin. |
320 GURL page_url_; | 316 GURL page_url_; |
321 | 317 |
322 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); | 318 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); |
323 }; | 319 }; |
324 | 320 |
325 } // namespace content | 321 } // namespace content |
326 | 322 |
327 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ | 323 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ |
OLD | NEW |