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

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

Issue 819953002: Mac: Update scrollbar size and input position during impl-overscroll (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Peure virtual Created 6 years 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/platform/scroll/ScrollbarThemeClient.h ('k') | Source/web/WebPluginScrollbarImpl.h » ('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) 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 static FloatSize scaleSizeToWindow(const Widget* widget, FloatSize size) 64 static FloatSize scaleSizeToWindow(const Widget* widget, FloatSize size)
65 { 65 {
66 return FloatSize(scaleDeltaToWindow(widget, size.width()), scaleDeltaToWindo w(widget, size.height())); 66 return FloatSize(scaleDeltaToWindow(widget, size.width()), scaleDeltaToWindo w(widget, size.height()));
67 } 67 }
68 68
69 static FloatPoint convertHitPointToWindow(const Widget* widget, FloatPoint point ) 69 static FloatPoint convertHitPointToWindow(const Widget* widget, FloatPoint point )
70 { 70 {
71 float scale = 1; 71 float scale = 1;
72 IntSize offset; 72 IntSize offset;
73 IntPoint pinchViewport; 73 IntPoint pinchViewport;
74 FloatSize overscrollOffset;
74 if (widget) { 75 if (widget) {
75 FrameView* rootView = toFrameView(widget->root()); 76 FrameView* rootView = toFrameView(widget->root());
76 if (rootView) { 77 if (rootView) {
77 scale = rootView->inputEventsScaleFactor(); 78 scale = rootView->inputEventsScaleFactor();
78 offset = rootView->inputEventsOffsetForEmulation(); 79 offset = rootView->inputEventsOffsetForEmulation();
79 pinchViewport = flooredIntPoint(rootView->page()->frameHost().pinchV iewport().visibleRect().location()); 80 pinchViewport = flooredIntPoint(rootView->page()->frameHost().pinchV iewport().visibleRect().location());
81 overscrollOffset = rootView->elasticOverscroll();
80 } 82 }
81 } 83 }
82 return FloatPoint( 84 return FloatPoint(
83 (point.x() - offset.width()) / scale + pinchViewport.x(), 85 (point.x() - offset.width()) / scale + pinchViewport.x() + overscrollOff set.width(),
84 (point.y() - offset.height()) / scale + pinchViewport.y()); 86 (point.y() - offset.height()) / scale + pinchViewport.y() + overscrollOf fset.height());
85 } 87 }
86 88
87 static int toWebEventModifiers(unsigned platformModifiers) 89 static int toWebEventModifiers(unsigned platformModifiers)
88 { 90 {
89 int newModifiers = 0; 91 int newModifiers = 0;
90 if (platformModifiers & PlatformEvent::ShiftKey) 92 if (platformModifiers & PlatformEvent::ShiftKey)
91 newModifiers |= WebInputEvent::ShiftKey; 93 newModifiers |= WebInputEvent::ShiftKey;
92 if (platformModifiers & PlatformEvent::CtrlKey) 94 if (platformModifiers & PlatformEvent::CtrlKey)
93 newModifiers |= WebInputEvent::ControlKey; 95 newModifiers |= WebInputEvent::ControlKey;
94 if (platformModifiers & PlatformEvent::AltKey) 96 if (platformModifiers & PlatformEvent::AltKey)
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 modifiers = getWebInputModifiers(event); 804 modifiers = getWebInputModifiers(event);
803 805
804 globalX = event.screenX(); 806 globalX = event.screenX();
805 globalY = event.screenY(); 807 globalY = event.screenY();
806 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); 808 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject);
807 x = localPoint.x(); 809 x = localPoint.x();
808 y = localPoint.y(); 810 y = localPoint.y();
809 } 811 }
810 812
811 } // namespace blink 813 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeClient.h ('k') | Source/web/WebPluginScrollbarImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698