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_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "ppapi/proxy/broker_dispatcher.h" | 18 #include "ppapi/proxy/broker_dispatcher.h" |
19 #include "ppapi/proxy/proxy_channel.h" | 19 #include "ppapi/proxy/proxy_channel.h" |
20 #include "webkit/plugins/ppapi/plugin_delegate.h" | 20 #include "webkit/plugins/ppapi/plugin_delegate.h" |
21 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
22 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
23 | 23 |
24 class FilePath; | 24 class FilePath; |
25 class PepperPluginDelegateImpl; | 25 class PepperPluginDelegateImpl; |
26 class RenderView; | 26 class RenderViewImpl; |
27 | 27 |
28 namespace gfx { | 28 namespace gfx { |
29 class Point; | 29 class Point; |
30 class Rect; | 30 class Rect; |
31 } | 31 } |
32 | 32 |
33 namespace IPC { | 33 namespace IPC { |
34 struct ChannelHandle; | 34 struct ChannelHandle; |
35 } | 35 } |
36 | 36 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 base::WeakPtr<PepperPluginDelegateImpl> delegate_; | 113 base::WeakPtr<PepperPluginDelegateImpl> delegate_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(PpapiBrokerImpl); | 115 DISALLOW_COPY_AND_ASSIGN(PpapiBrokerImpl); |
116 }; | 116 }; |
117 | 117 |
118 class PepperPluginDelegateImpl | 118 class PepperPluginDelegateImpl |
119 : public webkit::ppapi::PluginDelegate, | 119 : public webkit::ppapi::PluginDelegate, |
120 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { | 120 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { |
121 public: | 121 public: |
122 explicit PepperPluginDelegateImpl(RenderView* render_view); | 122 explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); |
123 virtual ~PepperPluginDelegateImpl(); | 123 virtual ~PepperPluginDelegateImpl(); |
124 | 124 |
125 // Attempts to create a PPAPI plugin for the given filepath. On success, it | 125 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
126 // will return the newly-created module. | 126 // will return the newly-created module. |
127 // | 127 // |
128 // There are two reasons for failure. The first is that the plugin isn't | 128 // There are two reasons for failure. The first is that the plugin isn't |
129 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | 129 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |
130 // to false and the caller may want to fall back on creating an NPAPI plugin. | 130 // to false and the caller may want to fall back on creating an NPAPI plugin. |
131 // the second is that the plugin failed to initialize. In this case, | 131 // the second is that the plugin failed to initialize. In this case, |
132 // |*pepper_plugin_was_registered| will be set to true and the caller should | 132 // |*pepper_plugin_was_registered| will be set to true and the caller should |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 // Asynchronously attempts to create a PPAPI broker for the given plugin. | 333 // Asynchronously attempts to create a PPAPI broker for the given plugin. |
334 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( | 334 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( |
335 webkit::ppapi::PluginModule* plugin_module); | 335 webkit::ppapi::PluginModule* plugin_module); |
336 | 336 |
337 bool MouseLockedOrPending() const { | 337 bool MouseLockedOrPending() const { |
338 return mouse_locked_ || pending_lock_request_ || pending_unlock_request_; | 338 return mouse_locked_ || pending_lock_request_ || pending_unlock_request_; |
339 } | 339 } |
340 | 340 |
341 // Pointer to the RenderView that owns us. | 341 // Pointer to the RenderView that owns us. |
342 RenderView* render_view_; | 342 RenderViewImpl* render_view_; |
343 | 343 |
344 std::set<webkit::ppapi::PluginInstance*> active_instances_; | 344 std::set<webkit::ppapi::PluginInstance*> active_instances_; |
345 | 345 |
346 // Used to send a single context menu "completion" upon menu close. | 346 // Used to send a single context menu "completion" upon menu close. |
347 bool has_saved_context_menu_action_; | 347 bool has_saved_context_menu_action_; |
348 unsigned saved_context_menu_action_; | 348 unsigned saved_context_menu_action_; |
349 | 349 |
350 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 350 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
351 | 351 |
352 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 352 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
(...skipping 30 matching lines...) Expand all Loading... |
383 // The plugin instance that received the last mouse event. It is set to NULL | 383 // The plugin instance that received the last mouse event. It is set to NULL |
384 // if the last mouse event went to elements other than Pepper plugins. | 384 // if the last mouse event went to elements other than Pepper plugins. |
385 // |last_mouse_event_target_| is not owned by this class. We can know about | 385 // |last_mouse_event_target_| is not owned by this class. We can know about |
386 // when it is destroyed via InstanceDeleted(). | 386 // when it is destroyed via InstanceDeleted(). |
387 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 387 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
388 | 388 |
389 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 389 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
390 }; | 390 }; |
391 | 391 |
392 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 392 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |