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

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

Issue 2843693003: Move methods from FrameViewBase to FrameView. (Closed)
Patch Set: address comments Created 3 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/page/Page.h" 44 #include "core/page/Page.h"
45 #include "platform/KeyboardCodes.h" 45 #include "platform/KeyboardCodes.h"
46 #include "public/platform/Platform.h" 46 #include "public/platform/Platform.h"
47 47
48 namespace blink { 48 namespace blink {
49 49
50 namespace { 50 namespace {
51 float FrameScale(const FrameView* frame_view) { 51 float FrameScale(const FrameView* frame_view) {
52 float scale = 1; 52 float scale = 1;
53 if (frame_view) { 53 if (frame_view) {
54 FrameView* root_view = ToFrameView(frame_view->Root()); 54 FrameView* root_view = frame_view->Root();
55 if (root_view) 55 if (root_view)
56 scale = root_view->InputEventsScaleFactor(); 56 scale = root_view->InputEventsScaleFactor();
57 } 57 }
58 return scale; 58 return scale;
59 } 59 }
60 60
61 FloatPoint FrameTranslation(const FrameView* frame_view) { 61 FloatPoint FrameTranslation(const FrameView* frame_view) {
62 float scale = 1; 62 float scale = 1;
63 FloatSize offset; 63 FloatSize offset;
64 IntPoint visual_viewport; 64 IntPoint visual_viewport;
65 FloatSize overscroll_offset; 65 FloatSize overscroll_offset;
66 if (frame_view) { 66 if (frame_view) {
67 FrameView* root_view = ToFrameView(frame_view->Root()); 67 FrameView* root_view = frame_view->Root();
68 if (root_view) { 68 if (root_view) {
69 scale = root_view->InputEventsScaleFactor(); 69 scale = root_view->InputEventsScaleFactor();
70 offset = FloatSize(root_view->InputEventsOffsetForEmulation()); 70 offset = FloatSize(root_view->InputEventsOffsetForEmulation());
71 visual_viewport = FlooredIntPoint( 71 visual_viewport = FlooredIntPoint(
72 root_view->GetPage()->GetVisualViewport().VisibleRect().Location()); 72 root_view->GetPage()->GetVisualViewport().VisibleRect().Location());
73 overscroll_offset = 73 overscroll_offset =
74 root_view->GetPage()->GetChromeClient().ElasticOverscroll(); 74 root_view->GetPage()->GetChromeClient().ElasticOverscroll();
75 } 75 }
76 } 76 }
77 return FloatPoint( 77 return FloatPoint(
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 Vector<WebTouchEvent> result; 380 Vector<WebTouchEvent> result;
381 for (const auto& event : coalesced_events) { 381 for (const auto& event : coalesced_events) {
382 DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); 382 DCHECK(WebInputEvent::IsTouchEventType(event->GetType()));
383 result.push_back(TransformWebTouchEvent( 383 result.push_back(TransformWebTouchEvent(
384 scale, translation, static_cast<const WebTouchEvent&>(*event))); 384 scale, translation, static_cast<const WebTouchEvent&>(*event)));
385 } 385 }
386 return result; 386 return result;
387 } 387 }
388 388
389 } // namespace blink 389 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698