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

Side by Side Diff: third_party/WebKit/Source/web/WebInputEventConversion.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 19 matching lines...) Expand all
30 30
31 #include "web/WebInputEventConversion.h" 31 #include "web/WebInputEventConversion.h"
32 32
33 #include "core/dom/Touch.h" 33 #include "core/dom/Touch.h"
34 #include "core/dom/TouchList.h" 34 #include "core/dom/TouchList.h"
35 #include "core/events/GestureEvent.h" 35 #include "core/events/GestureEvent.h"
36 #include "core/events/KeyboardEvent.h" 36 #include "core/events/KeyboardEvent.h"
37 #include "core/events/MouseEvent.h" 37 #include "core/events/MouseEvent.h"
38 #include "core/events/TouchEvent.h" 38 #include "core/events/TouchEvent.h"
39 #include "core/events/WheelEvent.h" 39 #include "core/events/WheelEvent.h"
40 #include "core/frame/FrameHost.h"
41 #include "core/frame/FrameView.h" 40 #include "core/frame/FrameView.h"
42 #include "core/frame/VisualViewport.h" 41 #include "core/frame/VisualViewport.h"
43 #include "core/layout/api/LayoutItem.h" 42 #include "core/layout/api/LayoutItem.h"
44 #include "core/page/ChromeClient.h" 43 #include "core/page/ChromeClient.h"
45 #include "core/page/Page.h" 44 #include "core/page/Page.h"
46 #include "platform/FrameViewBase.h" 45 #include "platform/FrameViewBase.h"
47 #include "platform/KeyboardCodes.h" 46 #include "platform/KeyboardCodes.h"
48 #include "public/platform/Platform.h" 47 #include "public/platform/Platform.h"
49 48
50 namespace blink { 49 namespace blink {
(...skipping 12 matching lines...) Expand all
63 FloatPoint frameTranslation(const FrameViewBase* frameViewBase) { 62 FloatPoint frameTranslation(const FrameViewBase* frameViewBase) {
64 float scale = 1; 63 float scale = 1;
65 FloatSize offset; 64 FloatSize offset;
66 IntPoint visualViewport; 65 IntPoint visualViewport;
67 FloatSize overscrollOffset; 66 FloatSize overscrollOffset;
68 if (frameViewBase) { 67 if (frameViewBase) {
69 FrameView* rootView = toFrameView(frameViewBase->root()); 68 FrameView* rootView = toFrameView(frameViewBase->root());
70 if (rootView) { 69 if (rootView) {
71 scale = rootView->inputEventsScaleFactor(); 70 scale = rootView->inputEventsScaleFactor();
72 offset = FloatSize(rootView->inputEventsOffsetForEmulation()); 71 offset = FloatSize(rootView->inputEventsOffsetForEmulation());
73 visualViewport = flooredIntPoint(rootView->page() 72 visualViewport = flooredIntPoint(
74 ->frameHost() 73 rootView->page()->visualViewport().visibleRect().location());
75 .visualViewport()
76 .visibleRect()
77 .location());
78 overscrollOffset = rootView->page()->chromeClient().elasticOverscroll(); 74 overscrollOffset = rootView->page()->chromeClient().elasticOverscroll();
79 } 75 }
80 } 76 }
81 return FloatPoint( 77 return FloatPoint(
82 -offset.width() / scale + visualViewport.x() + overscrollOffset.width(), 78 -offset.width() / scale + visualViewport.x() + overscrollOffset.width(),
83 -offset.height() / scale + visualViewport.y() + 79 -offset.height() / scale + visualViewport.y() +
84 overscrollOffset.height()); 80 overscrollOffset.height());
85 } 81 }
86 82
87 FloatPoint convertAbsoluteLocationForLayoutObjectFloat( 83 FloatPoint convertAbsoluteLocationForLayoutObjectFloat(
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 Vector<WebTouchEvent> result; 366 Vector<WebTouchEvent> result;
371 for (const auto& event : coalescedEvents) { 367 for (const auto& event : coalescedEvents) {
372 DCHECK(WebInputEvent::isTouchEventType(event->type())); 368 DCHECK(WebInputEvent::isTouchEventType(event->type()));
373 result.push_back(TransformWebTouchEvent( 369 result.push_back(TransformWebTouchEvent(
374 scale, translation, static_cast<const WebTouchEvent&>(*event))); 370 scale, translation, static_cast<const WebTouchEvent&>(*event)));
375 } 371 }
376 return result; 372 return result;
377 } 373 }
378 374
379 } // namespace blink 375 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698