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

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

Issue 8273029: PPAPI Fullscreen: In ViewChanged, check if the browser entered fullscreen mode (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « webkit/plugins/ppapi/plugin_delegate.h ('k') | 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 105483)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -745,26 +745,33 @@
if (sent_did_change_view_ && position == position_ && new_clip == clip_)
return;
- // TODO(polina): fullscreen transition might take multiple ViewChanged,
- // so this will update the state too early. Also, when F11 is used to
- // exit fullscreen mode, desired_fullscreen_state_ is not properly set
- // and cannot be relied on.
- // Pending fix: http://codereview.chromium.org/8273029/
- // WebKit: https://bugs.webkit.org/show_bug.cgi?id=70076.
- if (desired_fullscreen_state_ && !fullscreen_) {
- // Entered fullscreen. Only possible via SetFullscreen.
- fullscreen_ = true;
- } else if (!desired_fullscreen_state_ && fullscreen_) {
- // Exited fullscreen. Possible via SetFullscreen or F11/link.
- fullscreen_ = false;
- // Reset the size attributes that we hacked to fill in the screen and
- // retrigger ViewChanged. Make sure we don't forward duplicates of
- // this view to the plugin.
- ResetSizeAttributesAfterFullscreen();
- SetSentDidChangeView(position, new_clip);
- MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&PluginInstance::ReportGeometry, this));
- return;
+ if (desired_fullscreen_state_ || fullscreen_) {
+ WebElement element = container_->element();
+ WebDocument document = element.document();
+ // TODO(polina): temporary hack to ease WebKit/Chromium commit sequence.
+#ifdef WEBKIT_WEBDOCUMENT_HAS_FULLSCREENELEMENT
+ bool is_fullscreen_element = (element == document.fullScreenElement());
+#else
+ bool is_fullscreen_element = desired_fullscreen_state_;
+#endif
+ if (!fullscreen_ && desired_fullscreen_state_ &&
+ delegate()->IsInFullscreenMode() && is_fullscreen_element) {
+ // Entered fullscreen. Only possible via SetFullscreen().
+ fullscreen_ = true;
+ } else if (fullscreen_ && !is_fullscreen_element) {
+ // Exited fullscreen. Possible via SetFullscreen() or F11/link,
+ // so desired_fullscreen_state might be out-of-date.
+ desired_fullscreen_state_ = false;
+ fullscreen_ = false;
+ // Reset the size attributes that we hacked to fill in the screen and
+ // retrigger ViewChanged. Make sure we don't forward duplicates of
+ // this view to the plugin.
+ ResetSizeAttributesAfterFullscreen();
+ SetSentDidChangeView(position, new_clip);
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&PluginInstance::ReportGeometry, this));
+ return;
+ }
}
SetSentDidChangeView(position, new_clip);
« no previous file with comments | « webkit/plugins/ppapi/plugin_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698