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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.h

Issue 8970016: refactoring mouse lock to support pepper and WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments and whitespace Created 8 years, 11 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/pepper_plugin_delegate_impl.h
diff --git a/content/renderer/pepper_plugin_delegate_impl.h b/content/renderer/pepper_plugin_delegate_impl.h
index 22f5ab273b90a4d154aacb263be3958616dc6c55..f9f2131612ed45308dc94ee36e201eb4f3c5bf65 100644
--- a/content/renderer/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper_plugin_delegate_impl.h
@@ -197,15 +197,8 @@ class PepperPluginDelegateImpl
int selection_end);
void OnImeConfirmComposition(const string16& text);
- // Notification that the request to lock the mouse has completed.
- void OnLockMouseACK(bool succeeded);
- // Notification that the plugin instance has lost the mouse lock.
- void OnMouseLockLost();
// Notification that a mouse event has arrived at the render view.
- // Returns true if no further handling is needed. For example, if the mouse is
- // currently locked, this method directly dispatches the event to the owner of
- // the mouse lock and returns true.
- bool HandleMouseEvent(const WebKit::WebMouseEvent& event);
+ void WillHandleMouseEvent();
// PluginDelegate implementation.
virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance,
@@ -383,8 +376,9 @@ class PepperPluginDelegateImpl
virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size)
OVERRIDE;
virtual ::ppapi::Preferences GetPreferences() OVERRIDE;
- virtual void LockMouse(webkit::ppapi::PluginInstance* instance) OVERRIDE;
+ virtual bool LockMouse(webkit::ppapi::PluginInstance* instance) OVERRIDE;
virtual void UnlockMouse(webkit::ppapi::PluginInstance* instance) OVERRIDE;
+ virtual bool IsMouseLocked(webkit::ppapi::PluginInstance* instance) OVERRIDE;
virtual void DidChangeCursor(webkit::ppapi::PluginInstance* instance,
const WebKit::WebCursorInfo& cursor) OVERRIDE;
virtual void DidReceiveMouseEvent(
@@ -433,10 +427,6 @@ class PepperPluginDelegateImpl
scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker(
webkit::ppapi::PluginModule* plugin_module);
- bool MouseLockedOrPending() const {
- return mouse_locked_ || pending_lock_request_ || pending_unlock_request_;
- }
-
// Implementation of PepperParentContextProvider.
virtual RendererGLContext* GetParentContextForPlatformContext3D() OVERRIDE;
@@ -481,21 +471,6 @@ class PepperPluginDelegateImpl
// progress.
string16 composition_text_;
- // |mouse_lock_owner_| is not owned by this class. We can know about when it
- // is destroyed via InstanceDeleted().
- // |mouse_lock_owner_| being non-NULL doesn't indicate that currently the
- // mouse has been locked. It is possible that a request to lock the mouse has
- // been sent, but the response hasn't arrived yet.
- webkit::ppapi::PluginInstance* mouse_lock_owner_;
- bool mouse_locked_;
- // If both |pending_lock_request_| and |pending_unlock_request_| are true,
- // it means a lock request was sent before an unlock request and we haven't
- // received responses for them.
- // The logic in LockMouse() makes sure that a lock request won't be sent when
- // there is a pending unlock request.
- bool pending_lock_request_;
- bool pending_unlock_request_;
-
// 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.
// |last_mouse_event_target_| is not owned by this class. We can know about

Powered by Google App Engine
This is Rietveld 408576698