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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 if (!delay_report) { 1340 if (!delay_report) {
1341 ReportGeometry(); 1341 ReportGeometry();
1342 } else { 1342 } else {
1343 MessageLoop::current()->PostTask( 1343 MessageLoop::current()->PostTask(
1344 FROM_HERE, base::Bind(&PluginInstance::ReportGeometry, this)); 1344 FROM_HERE, base::Bind(&PluginInstance::ReportGeometry, this));
1345 } 1345 }
1346 } 1346 }
1347 } 1347 }
1348 1348
1349 void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) { 1349 void PluginInstance::UpdateFlashFullscreenState(bool flash_fullscreen) {
1350 if (flash_fullscreen == flash_fullscreen_) 1350 bool is_mouselock_pending = TrackedCallback::IsPending(lock_mouse_callback_);
1351
1352 if (flash_fullscreen == flash_fullscreen_) {
1353 // Manually clear callback when fullscreen fails with mouselock pending.
1354 if (!flash_fullscreen && is_mouselock_pending)
1355 TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
1351 return; 1356 return;
1357 }
1352 1358
1353 bool old_plugin_focus = PluginHasFocus(); 1359 bool old_plugin_focus = PluginHasFocus();
1354 flash_fullscreen_ = flash_fullscreen; 1360 flash_fullscreen_ = flash_fullscreen;
1361 if (is_mouselock_pending && !delegate()->IsMouseLocked(this))
1362 delegate()->LockMouse(this);
1363
1355 if (PluginHasFocus() != old_plugin_focus) 1364 if (PluginHasFocus() != old_plugin_focus)
1356 SendFocusChangeNotification(); 1365 SendFocusChangeNotification();
1357 } 1366 }
1358 1367
1359 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, 1368 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request,
1360 const char* target, 1369 const char* target,
1361 bool from_user_action) { 1370 bool from_user_action) {
1362 if (!container_) 1371 if (!container_)
1363 return PP_ERROR_FAILED; 1372 return PP_ERROR_FAILED;
1364 1373
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 scoped_refptr<TrackedCallback> callback) { 1993 scoped_refptr<TrackedCallback> callback) {
1985 if (TrackedCallback::IsPending(lock_mouse_callback_)) 1994 if (TrackedCallback::IsPending(lock_mouse_callback_))
1986 return PP_ERROR_INPROGRESS; 1995 return PP_ERROR_INPROGRESS;
1987 1996
1988 if (delegate()->IsMouseLocked(this)) 1997 if (delegate()->IsMouseLocked(this))
1989 return PP_OK; 1998 return PP_OK;
1990 1999
1991 if (!CanAccessMainFrame()) 2000 if (!CanAccessMainFrame())
1992 return PP_ERROR_NOACCESS; 2001 return PP_ERROR_NOACCESS;
1993 2002
1994 if (delegate()->LockMouse(this)) { 2003 // Attempt mouselock only if Flash isn't waiting on fullscreen.
raymes 2012/07/26 00:53:43 // If we are waiting on fullscreen then we will re
1995 lock_mouse_callback_ = callback; 2004 if (!FlashIsFullscreenOrPending() || flash_fullscreen()) {
1996 return PP_OK_COMPLETIONPENDING; 2005 if (!delegate()->LockMouse(this))
1997 } else { 2006 return PP_ERROR_FAILED;
1998 return PP_ERROR_FAILED;
1999 } 2007 }
2008
2009 // Either mouselock succeeded or a Flash fullscreen is pending.
2010 lock_mouse_callback_ = callback;
2011 return PP_OK_COMPLETIONPENDING;
2000 } 2012 }
2001 2013
2002 void PluginInstance::UnlockMouse(PP_Instance instance) { 2014 void PluginInstance::UnlockMouse(PP_Instance instance) {
2003 delegate()->UnlockMouse(this); 2015 delegate()->UnlockMouse(this);
2004 } 2016 }
2005 2017
2006 PP_Bool PluginInstance::GetDefaultPrintSettings( 2018 PP_Bool PluginInstance::GetDefaultPrintSettings(
2007 PP_Instance instance, 2019 PP_Instance instance,
2008 PP_PrintSettings_Dev* print_settings) { 2020 PP_PrintSettings_Dev* print_settings) {
2009 // TODO(raymes): Not implemented for in-process. 2021 // TODO(raymes): Not implemented for in-process.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 screen_size_for_fullscreen_ = gfx::Size(); 2236 screen_size_for_fullscreen_ = gfx::Size();
2225 WebElement element = container_->element(); 2237 WebElement element = container_->element();
2226 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2238 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2227 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2239 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2228 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2240 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2229 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2241 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2230 } 2242 }
2231 2243
2232 } // namespace ppapi 2244 } // namespace ppapi
2233 } // namespace webkit 2245 } // namespace webkit
OLDNEW
« 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