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

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

Issue 1914643005: Add support for entering/exiting HTML fullscreen from OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: parentCrossingFrameBoundaries -> nextLocalAncestorElement and updated WasResized comment Created 4 years, 7 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 #include "public/web/WebFrame.h" 139 #include "public/web/WebFrame.h"
140 #include "public/web/WebFrameClient.h" 140 #include "public/web/WebFrameClient.h"
141 #include "public/web/WebHitTestResult.h" 141 #include "public/web/WebHitTestResult.h"
142 #include "public/web/WebInputElement.h" 142 #include "public/web/WebInputElement.h"
143 #include "public/web/WebMeaningfulLayout.h" 143 #include "public/web/WebMeaningfulLayout.h"
144 #include "public/web/WebMediaPlayerAction.h" 144 #include "public/web/WebMediaPlayerAction.h"
145 #include "public/web/WebNode.h" 145 #include "public/web/WebNode.h"
146 #include "public/web/WebPlugin.h" 146 #include "public/web/WebPlugin.h"
147 #include "public/web/WebPluginAction.h" 147 #include "public/web/WebPluginAction.h"
148 #include "public/web/WebRange.h" 148 #include "public/web/WebRange.h"
149 #include "public/web/WebScopedUserGesture.h"
149 #include "public/web/WebSelection.h" 150 #include "public/web/WebSelection.h"
150 #include "public/web/WebTextInputInfo.h" 151 #include "public/web/WebTextInputInfo.h"
151 #include "public/web/WebViewClient.h" 152 #include "public/web/WebViewClient.h"
152 #include "public/web/WebWindowFeatures.h" 153 #include "public/web/WebWindowFeatures.h"
153 #include "web/CompositionUnderlineVectorBuilder.h" 154 #include "web/CompositionUnderlineVectorBuilder.h"
154 #include "web/ContextFeaturesClientImpl.h" 155 #include "web/ContextFeaturesClientImpl.h"
155 #include "web/ContextMenuAllowedScope.h" 156 #include "web/ContextMenuAllowedScope.h"
156 #include "web/DatabaseClientImpl.h" 157 #include "web/DatabaseClientImpl.h"
157 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" 158 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h"
158 #include "web/DevToolsEmulator.h" 159 #include "web/DevToolsEmulator.h"
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 1935
1935 void WebViewImpl::resize(const WebSize& newSize) 1936 void WebViewImpl::resize(const WebSize& newSize)
1936 { 1937 {
1937 if (m_shouldAutoResize || m_size == newSize) 1938 if (m_shouldAutoResize || m_size == newSize)
1938 return; 1939 return;
1939 1940
1940 resizeWithTopControls( 1941 resizeWithTopControls(
1941 newSize, topControls().height(), topControls().shrinkViewport()); 1942 newSize, topControls().height(), topControls().shrinkViewport());
1942 } 1943 }
1943 1944
1945 void WebViewImpl::willEnterFullScreen(WebRemoteFrame* fullscreenFrame)
1946 {
1947 FrameOwner* owner = toWebRemoteFrameImpl(fullscreenFrame)->frame()->owner();
dcheng 2016/05/19 22:08:39 In a future patch, let's try moving this to WebRem
alexmos 2016/05/19 23:58:19 Will do, I think that should be possible.
1948 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
1949
1950 // Let FullscreenController know that |ownerElement| is an ancestor of the
1951 // actual fullscreen element, so that it can be treated a little
1952 // differently:
1953 // - it will need :-webkit-full-screen-ancestor style in addition to
1954 // :-webkit-full-screen.
1955 // - it does not need to resend the ToggleFullscreen IPC to the browser
1956 // process.
1957 m_fullscreenController->setFullscreenIsForCrossProcessAncestor();
dcheng 2016/05/19 22:08:39 This seems like the main blocker against moving th
alexmos 2016/05/19 23:58:19 Yes, I think that should be feasible. In fact, on
dcheng 2016/05/20 07:01:44 Yeah, followup is fine. Thanks!
1958
1959 // Call requestFullScreen() on |ownerElement| to make it the provisional
1960 // fullscreen element in FullscreenController, and to prepare
1961 // fullscreenchange events that will need to fire on it and its (local)
1962 // ancestors. The events will be triggered if/when fullscreen is entered.
1963 // Note that requestFullscreen() requires a user gesture.
1964 //
1965 // TODO(alexmos): currently, WebElement::requestFullScreen assumes prefixed
1966 // requests, but in the future, this should plumb in information about
1967 // which request type (prefixed or unprefixed) to use for firing fullscreen
1968 // events.
1969 {
1970 WebElement element(ownerElement);
dcheng 2016/05/19 22:08:39 Nit: let's use the core API directly, I looked at
alexmos 2016/05/19 23:58:19 Done.
1971 WebScopedUserGesture userGesture;
1972 element.requestFullScreen();
1973 }
1974 }
1975
1944 void WebViewImpl::didEnterFullScreen() 1976 void WebViewImpl::didEnterFullScreen()
1945 { 1977 {
1946 m_fullscreenController->didEnterFullScreen(); 1978 m_fullscreenController->didEnterFullScreen();
1947 } 1979 }
1948 1980
1949 void WebViewImpl::didExitFullScreen() 1981 void WebViewImpl::didExitFullScreen()
1950 { 1982 {
1951 m_fullscreenController->didExitFullScreen(); 1983 m_fullscreenController->didExitFullScreen();
1952 } 1984 }
1953 1985
1986 void WebViewImpl::didUpdateFullScreenSize()
1987 {
1988 m_fullscreenController->updateSize();
1989 }
1990
1954 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) 1991 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic)
1955 { 1992 {
1956 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM onotonic); 1993 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM onotonic);
1957 DCHECK(lastFrameTimeMonotonic); 1994 DCHECK(lastFrameTimeMonotonic);
1958 1995
1959 // Create synthetic wheel events as necessary for fling. 1996 // Create synthetic wheel events as necessary for fling.
1960 if (m_gestureAnimation) { 1997 if (m_gestureAnimation) {
1961 if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) 1998 if (m_gestureAnimation->animate(lastFrameTimeMonotonic))
1962 scheduleAnimation(); 1999 scheduleAnimation();
1963 else { 2000 else {
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after
4524 { 4561 {
4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4562 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4563 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4527 if (!page()) 4564 if (!page())
4528 return 1; 4565 return 1;
4529 4566
4530 return page()->deviceScaleFactor(); 4567 return page()->deviceScaleFactor();
4531 } 4568 }
4532 4569
4533 } // namespace blink 4570 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698