OLD | NEW |
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/Fullscreen.h" |
8 #include "core/dom/RemoteSecurityContext.h" | 8 #include "core/dom/RemoteSecurityContext.h" |
9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 return false; | 499 return false; |
500 return owner->layoutObject()->style()->pointerEvents() == | 500 return owner->layoutObject()->style()->pointerEvents() == |
501 EPointerEvents::kNone; | 501 EPointerEvents::kNone; |
502 } | 502 } |
503 | 503 |
504 void WebRemoteFrameImpl::willEnterFullscreen() { | 504 void WebRemoteFrameImpl::willEnterFullscreen() { |
505 // This should only ever be called when the FrameOwner is local. | 505 // This should only ever be called when the FrameOwner is local. |
506 HTMLFrameOwnerElement* ownerElement = | 506 HTMLFrameOwnerElement* ownerElement = |
507 toHTMLFrameOwnerElement(frame()->owner()); | 507 toHTMLFrameOwnerElement(frame()->owner()); |
508 | 508 |
509 // Call |requestFullscreen()| on |ownerElement| to make it the pending | 509 // Call requestFullscreen() on |ownerElement| to make it the provisional |
510 // fullscreen element in anticipation of the coming |didEnterFullscreen()| | 510 // fullscreen element in FullscreenController, and to prepare |
511 // call. | 511 // fullscreenchange events that will need to fire on it and its (local) |
| 512 // ancestors. The events will be triggered if/when fullscreen is entered. |
512 // | 513 // |
513 // PrefixedForCrossProcessDescendant is necessary because: | 514 // Passing |forCrossProcessAncestor| to requestFullscreen is necessary |
514 // - The fullscreen element ready check and other checks should be bypassed. | 515 // because: |
515 // - |ownerElement| will need :-webkit-full-screen-ancestor style in addition | 516 // - |ownerElement| will need :-webkit-full-screen-ancestor style in |
516 // to :-webkit-full-screen. | 517 // addition to :-webkit-full-screen. |
| 518 // - there's no need to resend the ToggleFullscreen IPC to the browser |
| 519 // process. |
517 // | 520 // |
518 // TODO(alexmos): currently, this assumes prefixed requests, but in the | 521 // TODO(alexmos): currently, this assumes prefixed requests, but in the |
519 // future, this should plumb in information about which request type | 522 // future, this should plumb in information about which request type |
520 // (prefixed or unprefixed) to use for firing fullscreen events. | 523 // (prefixed or unprefixed) to use for firing fullscreen events. |
521 Fullscreen::requestFullscreen( | 524 Fullscreen::requestFullscreen(*ownerElement, |
522 *ownerElement, | 525 Fullscreen::RequestType::Prefixed, |
523 Fullscreen::RequestType::PrefixedForCrossProcessDescendant); | 526 true /* forCrossProcessAncestor */); |
524 } | 527 } |
525 | 528 |
526 void WebRemoteFrameImpl::setHasReceivedUserGesture() { | 529 void WebRemoteFrameImpl::setHasReceivedUserGesture() { |
527 frame()->setDocumentHasReceivedUserGesture(); | 530 frame()->setDocumentHasReceivedUserGesture(); |
528 } | 531 } |
529 | 532 |
530 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
531 WebRemoteFrameClient* client) | 534 WebRemoteFrameClient* client) |
532 : WebRemoteFrame(scope), | 535 : WebRemoteFrame(scope), |
533 m_frameClient(RemoteFrameClientImpl::create(this)), | 536 m_frameClient(RemoteFrameClientImpl::create(this)), |
534 m_client(client), | 537 m_client(client), |
535 m_selfKeepAlive(this) {} | 538 m_selfKeepAlive(this) {} |
536 | 539 |
537 } // namespace blink | 540 } // namespace blink |
OLD | NEW |