Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: content/renderer/render_widget.h

Issue 1962923002: Fix rendering of flash content inside an out-of-process iframe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for android builds Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_widget.h
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 5d0303e01c9cea44d23ba2fb5d8f651cbaa22337..cd7ce43810fde49fd0d357efe50de2e847fb9900 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -11,11 +11,13 @@
#include <deque>
#include <map>
#include <memory>
+#include <set>
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -84,6 +86,7 @@ class CompositorDependencies;
class ExternalPopupMenu;
class FrameSwapMessageQueue;
class ImeEventGuard;
+class PepperPluginInstanceImpl;
class RenderFrameImpl;
class RenderFrameProxy;
class RenderWidgetCompositor;
@@ -109,7 +112,8 @@ class CONTENT_EXPORT RenderWidget
public RenderWidgetCompositorDelegate,
public RenderWidgetInputHandlerDelegate,
public RenderWidgetScreenMetricsEmulatorDelegate,
- public base::RefCounted<RenderWidget> {
+ public base::RefCounted<RenderWidget>,
+ public base::SupportsWeakPtr<RenderWidget> {
public:
// Creates a new RenderWidget. The opener_id is the routing ID of the
// RenderView that this widget lives inside.
@@ -360,6 +364,31 @@ class CONTENT_EXPORT RenderWidget
void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile);
void ResetDeviceColorProfileForTesting();
+ // Plugin-related functions --------------------------------------------------
+
+#if defined(ENABLE_PLUGINS)
+ PepperPluginInstanceImpl* focused_pepper_plugin() {
+ return focused_pepper_plugin_;
+ }
+ PepperPluginInstanceImpl* pepper_last_mouse_event_target() {
+ return pepper_last_mouse_event_target_;
+ }
+ void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) {
+ pepper_last_mouse_event_target_ = plugin;
+ }
+
+ // Indicates that the given instance has been created.
+ void PepperInstanceCreated(PepperPluginInstanceImpl* instance);
+
+ // Indicates that the given instance is being destroyed. This is called from
+ // the destructor, so it's important that the instance is not dereferenced
+ // from this call.
+ void PepperInstanceDeleted(PepperPluginInstanceImpl* instance);
+
+ // Notification that the given plugin is focused or unfocused.
+ void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused);
+#endif // ENABLE_PLUGINS
+
protected:
// Friend RefCounted so that the dtor can be non-public. Using this class
// without ref-counting is an error.
@@ -748,6 +777,26 @@ class CONTENT_EXPORT RenderWidget
// visibility state for example.
base::ObserverList<RenderFrameImpl> render_frames_;
+ // Plugins -------------------------------------------------------------------
+#if defined(ENABLE_PLUGINS)
+ typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet;
+ PepperPluginSet active_pepper_instances_;
+
+ // TODO(jam): these belong on RenderFrame, once the browser knows which frame
+ // is focused and sends the IPCs which use these to the correct frame. Until
+ // then, we must store these on RenderView as that's the one place that knows
+ // about all the RenderFrames for a page.
+
+ // Whether or not the focus is on a PPAPI plugin
+ PepperPluginInstanceImpl* focused_pepper_plugin_;
+
+ // The plugin instance that received the last mouse event. It is set to NULL
+ // if the last mouse event went to elements other than Pepper plugins.
+ // |pepper_last_mouse_event_target_| is not owned by this class. We depend on
+ // the RenderFrameImpl to NULL it out when it destructs.
+ PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
+#endif
+
bool has_host_context_menu_location_;
gfx::Point host_context_menu_location_;

Powered by Google App Engine
This is Rietveld 408576698