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

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

Issue 225303014: [Pinch-to-zoom] Moved scale factor into PinchViewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed layout test breakage Created 6 years, 8 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
« no previous file with comments | « Source/web/FullscreenController.h ('k') | Source/web/InspectorClientImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void FullscreenController::didEnterFullScreen() 74 void FullscreenController::didEnterFullScreen()
75 { 75 {
76 if (!m_fullScreenFrame) 76 if (!m_fullScreenFrame)
77 return; 77 return;
78 78
79 if (Document* doc = m_fullScreenFrame->document()) { 79 if (Document* doc = m_fullScreenFrame->document()) {
80 if (FullscreenElementStack::isFullScreen(*doc)) { 80 if (FullscreenElementStack::isFullScreen(*doc)) {
81 if (!m_exitFullscreenPageScaleFactor) { 81 if (!m_exitFullscreenPageScaleFactor) {
82 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor (); 82 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor ();
83 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrol lOffset(); 83 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrol lOffset();
84 m_webViewImpl->setPageScaleFactorPreservingScrollOffset(1.0f); 84 m_exitFullscreenPinchViewportOffset = m_webViewImpl->pinchViewpo rtOffset();
85 m_webViewImpl->setPageScaleFactor(1.0f);
85 } 86 }
86 87
87 FullscreenElementStack::from(*doc).webkitDidEnterFullScreenForElemen t(0); 88 FullscreenElementStack::from(*doc).webkitDidEnterFullScreenForElemen t(0);
88 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) { 89 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) {
89 Element* element = FullscreenElementStack::currentFullScreenElem entFrom(*doc); 90 Element* element = FullscreenElementStack::currentFullScreenElem entFrom(*doc);
90 ASSERT(element); 91 ASSERT(element);
91 if (isHTMLMediaElement(*element) && m_webViewImpl->layerTreeView ()) 92 if (isHTMLMediaElement(*element) && m_webViewImpl->layerTreeView ())
92 m_webViewImpl->layerTreeView()->setHasTransparentBackground( true); 93 m_webViewImpl->layerTreeView()->setHasTransparentBackground( true);
93 } 94 }
94 } 95 }
(...skipping 24 matching lines...) Expand all
119 120
120 void FullscreenController::didExitFullScreen() 121 void FullscreenController::didExitFullScreen()
121 { 122 {
122 if (!m_fullScreenFrame) 123 if (!m_fullScreenFrame)
123 return; 124 return;
124 125
125 if (Document* doc = m_fullScreenFrame->document()) { 126 if (Document* doc = m_fullScreenFrame->document()) {
126 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfE xists(*doc)) { 127 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfE xists(*doc)) {
127 if (fullscreen->webkitIsFullScreen()) { 128 if (fullscreen->webkitIsFullScreen()) {
128 if (m_exitFullscreenPageScaleFactor) { 129 if (m_exitFullscreenPageScaleFactor) {
129 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF actor, 130 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF actor);
130 WebPoint(m_exitFullscreenScrollOffset.width(), m_exitFul lscreenScrollOffset.height())); 131 m_webViewImpl->setMainFrameScrollOffset(IntPoint(m_exitFulls creenScrollOffset));
132 m_webViewImpl->setPinchViewportOffset(m_exitFullscreenPinchV iewportOffset);
131 m_exitFullscreenPageScaleFactor = 0; 133 m_exitFullscreenPageScaleFactor = 0;
132 m_exitFullscreenScrollOffset = IntSize(); 134 m_exitFullscreenScrollOffset = IntSize();
133 } 135 }
134 136
135 fullscreen->webkitDidExitFullScreenForElement(0); 137 fullscreen->webkitDidExitFullScreenForElement(0);
136 } 138 }
137 } 139 }
138 } 140 }
139 141
140 m_fullScreenFrame.clear(); 142 m_fullScreenFrame.clear();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (mediaElement->player()) 190 if (mediaElement->player())
189 mediaElement->player()->hideFullscreenOverlay(); 191 mediaElement->player()->hideFullscreenOverlay();
190 return; 192 return;
191 } 193 }
192 if (WebViewClient* client = m_webViewImpl->client()) 194 if (WebViewClient* client = m_webViewImpl->client())
193 client->exitFullScreen(); 195 client->exitFullScreen();
194 } 196 }
195 197
196 } 198 }
197 199
OLDNEW
« no previous file with comments | « Source/web/FullscreenController.h ('k') | Source/web/InspectorClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698