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

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

Issue 889803004: Add touchpad pinch zoom support to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update tests Created 5 years, 10 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ; 2133 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ;
2134 return true; 2134 return true;
2135 } 2135 }
2136 2136
2137 // FIXME: This should take in the intended frame, not the local frame root. 2137 // FIXME: This should take in the intended frame, not the local frame root.
2138 if (PageWidgetDelegate::handleInputEvent(*this, inputEvent, localFrameRootTe mporary()->frame())) 2138 if (PageWidgetDelegate::handleInputEvent(*this, inputEvent, localFrameRootTe mporary()->frame()))
2139 return true; 2139 return true;
2140 2140
2141 // Unhandled touchpad gesture pinch events synthesize mouse wheel events. 2141 // Unhandled touchpad gesture pinch events synthesize mouse wheel events.
2142 if (inputEvent.type == WebInputEvent::GesturePinchUpdate) { 2142 if (inputEvent.type == WebInputEvent::GesturePinchUpdate) {
2143 if (handleSyntheticWheelFromTouchpadPinchEvent(static_cast<const WebGest ureEvent&>(inputEvent))) 2143 const WebGestureEvent& pinchEvent = static_cast<const WebGestureEvent&>( inputEvent);
2144
2145 // First, synthesize a Windows-like wheel event to send to any handlers that may exist.
2146 if (handleSyntheticWheelFromTouchpadPinchEvent(pinchEvent))
2144 return true; 2147 return true;
2148
2149 if (pinchVirtualViewportEnabled()
2150 && page()->frameHost().pinchViewport().magnifyScaleAroundAnchor(pinc hEvent.data.pinchUpdate.scale, FloatPoint(pinchEvent.x, pinchEvent.y)))
2151 return true;
2152
2153 // TODO(ccameron): Always return that the event was handled. Once the pi nch-zoom content scale
2154 // handlers have been removed from content, this function may return fal se if the page scale does
2155 // not change.
2156 return true;
2145 } 2157 }
2146 2158
2147 return false; 2159 return false;
2148 } 2160 }
2149 2161
2150 void WebViewImpl::setCursorVisibilityState(bool isVisible) 2162 void WebViewImpl::setCursorVisibilityState(bool isVisible)
2151 { 2163 {
2152 if (m_page) 2164 if (m_page)
2153 m_page->setIsCursorVisible(isVisible); 2165 m_page->setIsCursorVisible(isVisible);
2154 } 2166 }
(...skipping 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after
4606 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4618 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4607 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4619 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4608 } 4620 }
4609 4621
4610 void WebViewImpl::forceNextWebGLContextCreationToFail() 4622 void WebViewImpl::forceNextWebGLContextCreationToFail()
4611 { 4623 {
4612 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4624 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4613 } 4625 }
4614 4626
4615 } // namespace blink 4627 } // namespace blink
OLDNEW
« LayoutTests/fast/events/gesture-pinch-fake-mouse-wheel.html ('K') | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698