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