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

Side by Side Diff: Source/web/FullscreenController.cpp

Issue 1163433003: Remove WebViewImpl helper methods for setting scroll offset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 if (!m_fullScreenFrame) 71 if (!m_fullScreenFrame)
72 return; 72 return;
73 73
74 if (!m_exitFullscreenPageScaleFactor) { 74 if (!m_exitFullscreenPageScaleFactor) {
75 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor(); 75 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor();
76 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrollOffset( ); 76 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrollOffset( );
77 m_exitFullscreenPinchViewportOffset = m_webViewImpl->pinchViewportOffset (); 77 m_exitFullscreenPinchViewportOffset = m_webViewImpl->pinchViewportOffset ();
78 78
79 updatePageScaleConstraints(false); 79 updatePageScaleConstraints(false);
80 m_webViewImpl->setPageScaleFactor(1.0f); 80 m_webViewImpl->setPageScaleFactor(1.0f);
81 m_webViewImpl->setMainFrameScrollOffset(IntPoint()); 81 m_webViewImpl->mainFrame()->setScrollOffset(WebSize());
82 m_webViewImpl->setPinchViewportOffset(FloatPoint()); 82 m_webViewImpl->setPinchViewportOffset(FloatPoint());
83 } 83 }
84 84
85 Fullscreen::from(document).didEnterFullScreenForElement(element.get()); 85 Fullscreen::from(document).didEnterFullScreenForElement(element.get());
86 ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element); 86 ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element);
87 87
88 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) { 88 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) {
89 if (isHTMLVideoElement(element)) { 89 if (isHTMLVideoElement(element)) {
90 HTMLVideoElement* videoElement = toHTMLVideoElement(element); 90 HTMLVideoElement* videoElement = toHTMLVideoElement(element);
91 if (HTMLMediaElement::isMediaStreamURL(videoElement->sourceURL().str ing())) 91 if (HTMLMediaElement::isMediaStreamURL(videoElement->sourceURL().str ing()))
(...skipping 22 matching lines...) Expand all
114 m_isCancelingFullScreen = true; 114 m_isCancelingFullScreen = true;
115 Fullscreen::fullyExitFullscreen(*document); 115 Fullscreen::fullyExitFullscreen(*document);
116 m_isCancelingFullScreen = false; 116 m_isCancelingFullScreen = false;
117 117
118 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && m _webViewImpl->layerTreeView()) 118 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && m _webViewImpl->layerTreeView())
119 m_webViewImpl->layerTreeView()->setHasTransparentBackground( m_webViewImpl->isTransparent()); 119 m_webViewImpl->layerTreeView()->setHasTransparentBackground( m_webViewImpl->isTransparent());
120 120
121 if (m_exitFullscreenPageScaleFactor) { 121 if (m_exitFullscreenPageScaleFactor) {
122 updatePageScaleConstraints(true); 122 updatePageScaleConstraints(true);
123 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF actor); 123 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF actor);
124 m_webViewImpl->setMainFrameScrollOffset(IntPoint(m_exitFulls creenScrollOffset)); 124 m_webViewImpl->mainFrame()->setScrollOffset(WebSize(m_exitFu llscreenScrollOffset));
125 m_webViewImpl->setPinchViewportOffset(m_exitFullscreenPinchV iewportOffset); 125 m_webViewImpl->setPinchViewportOffset(m_exitFullscreenPinchV iewportOffset);
126 m_exitFullscreenPageScaleFactor = 0; 126 m_exitFullscreenPageScaleFactor = 0;
127 m_exitFullscreenScrollOffset = IntSize(); 127 m_exitFullscreenScrollOffset = IntSize();
128 } 128 }
129 129
130 fullscreen->didExitFullScreenForElement(0); 130 fullscreen->didExitFullScreenForElement(0);
131 } 131 }
132 } 132 }
133 } 133 }
134 134
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 DEFINE_TRACE(FullscreenController) 198 DEFINE_TRACE(FullscreenController)
199 { 199 {
200 visitor->trace(m_provisionalFullScreenElement); 200 visitor->trace(m_provisionalFullScreenElement);
201 visitor->trace(m_fullScreenFrame); 201 visitor->trace(m_fullScreenFrame);
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
205 205
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698