summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_widget_host_view_aura.h
diff options
context:
space:
mode:
authortdanderson@google.com <tdanderson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 20:16:00 +0000
committertdanderson@google.com <tdanderson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 20:16:00 +0000
commita01746e1507b0b2256eebced9c7d892b8712a654 (patch)
treebf46dd6b4c4bb54b2bdfc5f4195e17abbc018e3f /content/browser/renderer_host/render_widget_host_view_aura.h
parent8136b62262f65e6053cbf2d0ee45a9fc9a43c051 (diff)
downloadchromium_src-a01746e1507b0b2256eebced9c7d892b8712a654.zip
chromium_src-a01746e1507b0b2256eebced9c7d892b8712a654.tar.gz
chromium_src-a01746e1507b0b2256eebced9c7d892b8712a654.tar.bz2
Notify all visible renderers when the visibility of the mouse cursor changes
Blink side patch: https://codereview.chromium.org/14047016/ The ultimate goal of both patches is to disallow new hover effects from being invoked in web contents when the mouse cursor is not visible to the user (i.e., while touch scrolling). The job of this patch is to communicate the cursor visibility state to all visible renderers using the new IPC InputMsg_CursorVisibilityChange whenever the visibility state changes. Added the new observer type CursorClientObserver. Subscribers (instances of RenderWidgetHostViewAura) are notified whenever the cursor visibility changes, at which point the IPC is sent to the renderer. I have also removed the code in ash_native_cursor_manager.cc that sets the mouse cursor location to the bogus value of (-10000,-10000) when mouse events are disabled; afaik this was originally added as a way to prevent unwanted hover effects in web contents but it does not work in all cases and causes other problems (see crbug.com/174358). BUG=153784,174358 R=jamesr@chromium.org, kenrb@chromium.org, oshima@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/14047015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198519 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_widget_host_view_aura.h')
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 86d6144..b1e3a7e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -22,6 +22,7 @@
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/aura/client/activation_change_observer.h"
#include "ui/aura/client/activation_delegate.h"
+#include "ui/aura/client/cursor_client_observer.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window_delegate.h"
@@ -66,6 +67,7 @@ class RenderWidgetHostViewAura
public aura::client::ActivationDelegate,
public aura::client::ActivationChangeObserver,
public aura::client::FocusChangeObserver,
+ public aura::client::CursorClientObserver,
public ImageTransportFactoryObserver,
public BrowserAccessibilityDelegate,
public base::SupportsWeakPtr<RenderWidgetHostViewAura> {
@@ -297,6 +299,9 @@ class RenderWidgetHostViewAura
virtual void OnWindowActivated(aura::Window* gained_activation,
aura::Window* lost_activation) OVERRIDE;
+ // Overridden from aura::client::CursorClientObserver:
+ virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE;
+
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) OVERRIDE;
@@ -386,6 +391,10 @@ class RenderWidgetHostViewAura
// mouse lock on all mouse move events.
void ModifyEventMovementAndCoords(WebKit::WebMouseEvent* event);
+ // Sends an IPC to the renderer process to communicate whether or not
+ // the mouse cursor is visible anywhere on the screen.
+ void NotifyRendererOfCursorVisibilityState(bool is_visible);
+
// If |clip| is non-empty and and doesn't contain |rect| or |clip| is empty
// SchedulePaint() is invoked for |rect|.
void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip);
@@ -613,6 +622,15 @@ class RenderWidgetHostViewAura
};
CanLockCompositorState can_lock_compositor_;
+ // Used to track the last cursor visibility update that was sent to the
+ // renderer via NotifyRendererOfCursorVisibilityState().
+ enum CursorVisibilityState {
+ UNKNOWN,
+ VISIBLE,
+ NOT_VISIBLE,
+ };
+ CursorVisibilityState cursor_visibility_state_in_renderer_;
+
// An observer to notify that the paint content of the view has changed. The
// observer is not owned by the view, and must remove itself as an oberver
// when it is being destroyed.