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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10824029: Queue Flash mouselock request if fullscreen is pending (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 148131)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -1347,11 +1347,22 @@
}
void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) {
- if (flash_fullscreen == flash_fullscreen_)
+ bool is_mouselock_pending = TrackedCallback::IsPending(lock_mouse_callback_);
+
+ if (flash_fullscreen == flash_fullscreen_) {
+ // Manually clear callback when fullscreen fails with mouselock pending.
+ if (!flash_fullscreen && is_mouselock_pending)
+ TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
return;
+ }
bool old_plugin_focus = PluginHasFocus();
flash_fullscreen_ = flash_fullscreen;
+ if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) {
+ if (!delegate()->LockMouse(this))
+ TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
+ }
+
if (PluginHasFocus() != old_plugin_focus)
SendFocusChangeNotification();
}
@@ -1991,12 +2002,16 @@
if (!CanAccessMainFrame())
return PP_ERROR_NOACCESS;
- if (delegate()->LockMouse(this)) {
- lock_mouse_callback_ = callback;
- return PP_OK_COMPLETIONPENDING;
- } else {
- return PP_ERROR_FAILED;
+ // Attempt mouselock only if Flash isn't waiting on fullscreen, otherwise
+ // we wait and call LockMouse() in UpdateFlashFullscreenState().
+ if (!FlashIsFullscreenOrPending() || flash_fullscreen()) {
+ if (!delegate()->LockMouse(this))
+ return PP_ERROR_FAILED;
}
+
+ // Either mouselock succeeded or a Flash fullscreen is pending.
+ lock_mouse_callback_ = callback;
+ return PP_OK_COMPLETIONPENDING;
}
void PluginInstance::UnlockMouse(PP_Instance instance) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698