| 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 "bindings/core/v8/WindowProxy.h" | 7 #include "bindings/core/v8/WindowProxy.h" |
| 8 #include "core/dom/Fullscreen.h" | 8 #include "core/dom/Fullscreen.h" |
| 9 #include "core/dom/RemoteSecurityContext.h" | 9 #include "core/dom/RemoteSecurityContext.h" |
| 10 #include "core/dom/SecurityContext.h" | 10 #include "core/dom/SecurityContext.h" |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 return false; | 486 return false; |
| 487 return owner->GetLayoutObject()->Style()->PointerEvents() == | 487 return owner->GetLayoutObject()->Style()->PointerEvents() == |
| 488 EPointerEvents::kNone; | 488 EPointerEvents::kNone; |
| 489 } | 489 } |
| 490 | 490 |
| 491 void WebRemoteFrameImpl::WillEnterFullscreen() { | 491 void WebRemoteFrameImpl::WillEnterFullscreen() { |
| 492 // This should only ever be called when the FrameOwner is local. | 492 // This should only ever be called when the FrameOwner is local. |
| 493 HTMLFrameOwnerElement* owner_element = | 493 HTMLFrameOwnerElement* owner_element = |
| 494 ToHTMLFrameOwnerElement(GetFrame()->Owner()); | 494 ToHTMLFrameOwnerElement(GetFrame()->Owner()); |
| 495 | 495 |
| 496 // Call requestFullscreen() on |ownerElement| to make it the provisional | 496 // Call |requestFullscreen()| on |ownerElement| to make it the pending |
| 497 // fullscreen element in FullscreenController, and to prepare | 497 // fullscreen element in anticipation of the coming |didEnterFullscreen()| |
| 498 // fullscreenchange events that will need to fire on it and its (local) | 498 // call. |
| 499 // ancestors. The events will be triggered if/when fullscreen is entered. | |
| 500 // | 499 // |
| 501 // Passing |forCrossProcessAncestor| to requestFullscreen is necessary | 500 // PrefixedForCrossProcessDescendant is necessary because: |
| 502 // because: | 501 // - The fullscreen element ready check and other checks should be bypassed. |
| 503 // - |ownerElement| will need :-webkit-full-screen-ancestor style in | 502 // - |ownerElement| will need :-webkit-full-screen-ancestor style in addition |
| 504 // addition to :-webkit-full-screen. | 503 // to :-webkit-full-screen. |
| 505 // - there's no need to resend the ToggleFullscreen IPC to the browser | |
| 506 // process. | |
| 507 // | 504 // |
| 508 // TODO(alexmos): currently, this assumes prefixed requests, but in the | 505 // TODO(alexmos): currently, this assumes prefixed requests, but in the |
| 509 // future, this should plumb in information about which request type | 506 // future, this should plumb in information about which request type |
| 510 // (prefixed or unprefixed) to use for firing fullscreen events. | 507 // (prefixed or unprefixed) to use for firing fullscreen events. |
| 511 Fullscreen::RequestFullscreen(*owner_element, | 508 Fullscreen::RequestFullscreen( |
| 512 Fullscreen::RequestType::kPrefixed, | 509 *owner_element, |
| 513 true /* forCrossProcessAncestor */); | 510 Fullscreen::RequestType::kPrefixedForCrossProcessDescendant); |
| 514 } | 511 } |
| 515 | 512 |
| 516 void WebRemoteFrameImpl::SetHasReceivedUserGesture() { | 513 void WebRemoteFrameImpl::SetHasReceivedUserGesture() { |
| 517 GetFrame()->SetDocumentHasReceivedUserGesture(); | 514 GetFrame()->SetDocumentHasReceivedUserGesture(); |
| 518 } | 515 } |
| 519 | 516 |
| 520 v8::Local<v8::Object> WebRemoteFrameImpl::GlobalProxy() const { | 517 v8::Local<v8::Object> WebRemoteFrameImpl::GlobalProxy() const { |
| 521 return GetFrame() | 518 return GetFrame() |
| 522 ->GetWindowProxy(DOMWrapperWorld::MainWorld()) | 519 ->GetWindowProxy(DOMWrapperWorld::MainWorld()) |
| 523 ->GlobalProxyIfNotDetached(); | 520 ->GlobalProxyIfNotDetached(); |
| 524 } | 521 } |
| 525 | 522 |
| 526 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 523 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
| 527 WebRemoteFrameClient* client) | 524 WebRemoteFrameClient* client) |
| 528 : WebRemoteFrameBase(scope), | 525 : WebRemoteFrameBase(scope), |
| 529 frame_client_(RemoteFrameClientImpl::Create(this)), | 526 frame_client_(RemoteFrameClientImpl::Create(this)), |
| 530 client_(client), | 527 client_(client), |
| 531 self_keep_alive_(this) {} | 528 self_keep_alive_(this) {} |
| 532 | 529 |
| 533 } // namespace blink | 530 } // namespace blink |
| OLD | NEW |