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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10826209: gestures: Generate only either scroll-end or fling-start events at the end of a scroll gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-fix Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <peninputpanel_i.c> 9 #include <peninputpanel_i.c>
10 #include <stack> 10 #include <stack>
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2873 ::DestroyWindow(tooltip_hwnd_); 2873 ::DestroyWindow(tooltip_hwnd_);
2874 tooltip_hwnd_ = NULL; 2874 tooltip_hwnd_ = NULL;
2875 } 2875 }
2876 2876
2877 bool RenderWidgetHostViewWin::ForwardGestureEventToRenderer( 2877 bool RenderWidgetHostViewWin::ForwardGestureEventToRenderer(
2878 ui::GestureEvent* gesture) { 2878 ui::GestureEvent* gesture) {
2879 if (!render_widget_host_) 2879 if (!render_widget_host_)
2880 return false; 2880 return false;
2881 2881
2882 LocalGestureEvent* local = static_cast<LocalGestureEvent*>(gesture); 2882 LocalGestureEvent* local = static_cast<LocalGestureEvent*>(gesture);
2883 if (local->data().type == WebKit::WebGestureEvent::Undefined) 2883 if (local->data().type == WebKit::WebInputEvent::Undefined)
2884 return false; 2884 return false;
2885 const WebKit::WebGestureEvent& generatedEvent = local->data(); 2885 const WebKit::WebGestureEvent& gesture_event = local->data();
2886 render_widget_host_->ForwardGestureEvent(generatedEvent); 2886 if (gesture_event.type == WebKit::WebInputEvent::GestureFlingStart) {
2887 // WebKit requires that a scroll ends first before a fling starts.
rjkroege 2012/08/09 16:51:06 same comment. :-)
2888 WebKit::WebGestureEvent scroll_end = gesture_event;
2889 scroll_end.type = WebKit::WebInputEvent::GestureScrollEnd;
2890 render_widget_host_->ForwardGestureEvent(scroll_end);
2891 }
2892 render_widget_host_->ForwardGestureEvent(gesture_event);
2887 return true; 2893 return true;
2888 } 2894 }
2889 2895
2890 void RenderWidgetHostViewWin::ForwardMouseEventToRenderer(UINT message, 2896 void RenderWidgetHostViewWin::ForwardMouseEventToRenderer(UINT message,
2891 WPARAM wparam, 2897 WPARAM wparam,
2892 LPARAM lparam) { 2898 LPARAM lparam) {
2893 TRACE_EVENT0("browser", 2899 TRACE_EVENT0("browser",
2894 "RenderWidgetHostViewWin::ForwardMouseEventToRenderer"); 2900 "RenderWidgetHostViewWin::ForwardMouseEventToRenderer");
2895 if (!render_widget_host_) { 2901 if (!render_widget_host_) {
2896 TRACE_EVENT0("browser", "EarlyOut_NoRWH"); 2902 TRACE_EVENT0("browser", "EarlyOut_NoRWH");
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3166 // receive a focus change in the context of a pointer down message, it means 3172 // receive a focus change in the context of a pointer down message, it means
3167 // that the pointer down message occurred on the edit field and we should 3173 // that the pointer down message occurred on the edit field and we should
3168 // display the on screen keyboard 3174 // display the on screen keyboard
3169 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3175 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3170 DisplayOnScreenKeyboardIfNeeded(); 3176 DisplayOnScreenKeyboardIfNeeded();
3171 received_focus_change_after_pointer_down_ = false; 3177 received_focus_change_after_pointer_down_ = false;
3172 pointer_down_context_ = false; 3178 pointer_down_context_ = false;
3173 } 3179 }
3174 3180
3175 } // namespace content 3181 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698