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

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

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/WebFrameWidgetBase.h" 5 #include "web/WebFrameWidgetBase.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 void WebFrameWidgetBase::dragSourceEndedAt(const WebPoint& pointInViewport, 135 void WebFrameWidgetBase::dragSourceEndedAt(const WebPoint& pointInViewport,
136 const WebPoint& screenPoint, 136 const WebPoint& screenPoint,
137 WebDragOperation operation) { 137 WebDragOperation operation) {
138 if (ignoreInputEvents()) { 138 if (ignoreInputEvents()) {
139 cancelDrag(); 139 cancelDrag();
140 return; 140 return;
141 } 141 }
142 WebFloatPoint pointInRootFrame( 142 WebFloatPoint pointInRootFrame(
143 page()->frameHost().visualViewport().viewportToRootFrame( 143 page()->visualViewport().viewportToRootFrame(pointInViewport));
144 pointInViewport));
145 144
146 WebMouseEvent fakeMouseMove(WebInputEvent::MouseMove, pointInRootFrame, 145 WebMouseEvent fakeMouseMove(WebInputEvent::MouseMove, pointInRootFrame,
147 WebFloatPoint(screenPoint.x, screenPoint.y), 146 WebFloatPoint(screenPoint.x, screenPoint.y),
148 WebPointerProperties::Button::Left, 0, 147 WebPointerProperties::Button::Left, 0,
149 WebInputEvent::NoModifiers, 148 WebInputEvent::NoModifiers,
150 TimeTicks::Now().InSeconds()); 149 TimeTicks::Now().InSeconds());
151 fakeMouseMove.setFrameScale(1); 150 fakeMouseMove.setFrameScale(1);
152 toCoreFrame(localRoot()) 151 toCoreFrame(localRoot())
153 ->eventHandler() 152 ->eventHandler()
154 .dragSourceEndedAt(fakeMouseMove, static_cast<DragOperation>(operation)); 153 .dragSourceEndedAt(fakeMouseMove, static_cast<DragOperation>(operation));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (!(dropEffect & dragData.draggingSourceOperationMask())) 208 if (!(dropEffect & dragData.draggingSourceOperationMask()))
210 dropEffect = DragOperationNone; 209 dropEffect = DragOperationNone;
211 210
212 m_dragOperation = static_cast<WebDragOperation>(dropEffect); 211 m_dragOperation = static_cast<WebDragOperation>(dropEffect);
213 212
214 return m_dragOperation; 213 return m_dragOperation;
215 } 214 }
216 215
217 WebPoint WebFrameWidgetBase::viewportToRootFrame( 216 WebPoint WebFrameWidgetBase::viewportToRootFrame(
218 const WebPoint& pointInViewport) const { 217 const WebPoint& pointInViewport) const {
219 return page()->frameHost().visualViewport().viewportToRootFrame( 218 return page()->visualViewport().viewportToRootFrame(pointInViewport);
220 pointInViewport);
221 } 219 }
222 220
223 WebViewImpl* WebFrameWidgetBase::view() const { 221 WebViewImpl* WebFrameWidgetBase::view() const {
224 return toWebLocalFrameImpl(localRoot())->viewImpl(); 222 return toWebLocalFrameImpl(localRoot())->viewImpl();
225 } 223 }
226 224
227 Page* WebFrameWidgetBase::page() const { 225 Page* WebFrameWidgetBase::page() const {
228 return view()->page(); 226 return view()->page();
229 } 227 }
230 228
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 269
272 if (page()) { 270 if (page()) {
273 WebMouseEvent transformedEvent = TransformWebMouseEvent( 271 WebMouseEvent transformedEvent = TransformWebMouseEvent(
274 toWebLocalFrameImpl(localRoot())->frameView(), mouseEvent); 272 toWebLocalFrameImpl(localRoot())->frameView(), mouseEvent);
275 page()->pointerLockController().dispatchLockedMouseEvent(transformedEvent, 273 page()->pointerLockController().dispatchLockedMouseEvent(transformedEvent,
276 eventType); 274 eventType);
277 } 275 }
278 } 276 }
279 277
280 } // namespace blink 278 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlay.cpp ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698