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

Side by Side Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 2021513002: Move willEnterFullscreen to WebRemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about user gestures Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "web/WebRemoteFrameImpl.h" 5 #include "web/WebRemoteFrameImpl.h"
6 6
7 #include "core/dom/Fullscreen.h"
7 #include "core/dom/RemoteSecurityContext.h" 8 #include "core/dom/RemoteSecurityContext.h"
8 #include "core/dom/SecurityContext.h" 9 #include "core/dom/SecurityContext.h"
9 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
10 #include "core/frame/Settings.h" 11 #include "core/frame/Settings.h"
11 #include "core/frame/csp/ContentSecurityPolicy.h" 12 #include "core/frame/csp/ContentSecurityPolicy.h"
12 #include "core/html/HTMLFrameOwnerElement.h" 13 #include "core/html/HTMLFrameOwnerElement.h"
13 #include "core/layout/LayoutObject.h" 14 #include "core/layout/LayoutObject.h"
14 #include "core/page/Page.h" 15 #include "core/page/Page.h"
15 #include "platform/heap/Handle.h" 16 #include "platform/heap/Handle.h"
16 #include "public/platform/WebFloatRect.h" 17 #include "public/platform/WebFloatRect.h"
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 700 }
700 701
701 bool WebRemoteFrameImpl::isIgnoredForHitTest() const 702 bool WebRemoteFrameImpl::isIgnoredForHitTest() const
702 { 703 {
703 HTMLFrameOwnerElement* owner = frame()->deprecatedLocalOwner(); 704 HTMLFrameOwnerElement* owner = frame()->deprecatedLocalOwner();
704 if (!owner || !owner->layoutObject()) 705 if (!owner || !owner->layoutObject())
705 return false; 706 return false;
706 return owner->layoutObject()->style()->pointerEvents() == PE_NONE; 707 return owner->layoutObject()->style()->pointerEvents() == PE_NONE;
707 } 708 }
708 709
710 void WebRemoteFrameImpl::willEnterFullScreen()
711 {
712 // This should only ever be called when the FrameOwner is local.
713 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(frame()->owner ());
714
715 // Call requestFullscreen() on |ownerElement| to make it the provisional
716 // fullscreen element in FullscreenController, and to prepare
717 // fullscreenchange events that will need to fire on it and its (local)
718 // ancestors. The events will be triggered if/when fullscreen is entered.
719 //
720 // Passing |forCrossProcessAncestor| to requestFullscreen is necessary
721 // because:
722 // - |ownerElement| will need :-webkit-full-screen-ancestor style in
723 // addition to :-webkit-full-screen.
724 // - there's no need to resend the ToggleFullscreen IPC to the browser
725 // process.
726 //
727 // TODO(alexmos): currently, this assumes prefixed requests, but in the
728 // future, this should plumb in information about which request type
729 // (prefixed or unprefixed) to use for firing fullscreen events.
730 Fullscreen::from(ownerElement->document()).requestFullscreen(*ownerElement, Fullscreen::PrefixedRequest, true /* forCrossProcessAncestor */);
731 }
732
709 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, WebRemoteFrameCli ent* client) 733 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, WebRemoteFrameCli ent* client)
710 : WebRemoteFrame(scope) 734 : WebRemoteFrame(scope)
711 , m_frameClient(RemoteFrameClientImpl::create(this)) 735 , m_frameClient(RemoteFrameClientImpl::create(this))
712 , m_client(client) 736 , m_client(client)
713 , m_selfKeepAlive(this) 737 , m_selfKeepAlive(this)
714 { 738 {
715 } 739 }
716 740
717 } // namespace blink 741 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698