summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins/ppapi/ppapi_plugin_instance.cc')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc30
1 files changed, 9 insertions, 21 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 23a1862..7f849f6 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1675,13 +1675,13 @@ bool PluginInstance::IsFullPagePlugin() const {
return frame->view()->mainFrame()->document().isPluginDocument();
}
-void PluginInstance::OnLockMouseACK(bool succeeded) {
+void PluginInstance::OnLockMouseACK(int32_t result) {
if (!lock_mouse_callback_.func) {
NOTREACHED();
return;
}
- PP_RunAndClearCompletionCallback(&lock_mouse_callback_,
- succeeded ? PP_OK : PP_ERROR_FAILED);
+
+ PP_RunAndClearCompletionCallback(&lock_mouse_callback_, result);
}
void PluginInstance::OnMouseLockLost() {
@@ -1689,13 +1689,6 @@ void PluginInstance::OnMouseLockLost() {
plugin_mouse_lock_interface_->MouseLockLost(pp_instance());
}
-void PluginInstance::HandleMouseLockedInputEvent(
- const WebKit::WebMouseEvent& event) {
- // |cursor_info| is ignored since it is hidden when the mouse is locked.
- WebKit::WebCursorInfo cursor_info;
- HandleInputEvent(event, &cursor_info);
-}
-
void PluginInstance::SimulateInputEvent(const InputEventData& input_event) {
WebView* web_view = container()->element().document().frame()->view();
if (!web_view) {
@@ -1981,21 +1974,16 @@ int32_t PluginInstance::LockMouse(PP_Instance instance,
// Don't support synchronous call.
return PP_ERROR_BLOCKS_MAIN_THREAD;
}
- if (lock_mouse_callback_.func) // A lock is pending.
+ if (lock_mouse_callback_.func)
return PP_ERROR_INPROGRESS;
-
- if (delegate()->IsMouseLocked(this))
- return PP_OK;
-
if (!CanAccessMainFrame())
return PP_ERROR_NOACCESS;
- if (delegate()->LockMouse(this)) {
- lock_mouse_callback_ = callback;
- return PP_OK_COMPLETIONPENDING;
- } else {
- return PP_ERROR_FAILED;
- }
+ lock_mouse_callback_ = callback;
+ // We will be notified on completion via OnLockMouseACK(), either
+ // synchronously or asynchronously.
+ delegate()->LockMouse(this);
+ return PP_OK_COMPLETIONPENDING;
}
void PluginInstance::UnlockMouse(PP_Instance instance) {