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

Side by Side Diff: content/renderer/input/input_event_filter.cc

Issue 136173004: Early terminate flings when scrolling impossible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/input/input_event_filter.h" 5 #include "content/renderer/input/input_event_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/message_loop/message_loop_proxy.h" 11 #include "base/message_loop/message_loop_proxy.h"
12 #include "cc/input/input_handler.h" 12 #include "cc/input/input_handler.h"
13 #include "content/common/input/did_overscroll_params.h"
13 #include "content/common/input/web_input_event_traits.h" 14 #include "content/common/input/web_input_event_traits.h"
14 #include "content/common/input_messages.h" 15 #include "content/common/input_messages.h"
15 #include "content/common/view_messages.h" 16 #include "content/common/view_messages.h"
16 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
17 #include "ui/gfx/vector2d_f.h" 18 #include "ui/gfx/vector2d_f.h"
18 19
19 using blink::WebInputEvent; 20 using blink::WebInputEvent;
20 21
21 #include "ipc/ipc_message_null_macros.h" 22 #include "ipc/ipc_message_null_macros.h"
22 #undef IPC_MESSAGE_DECL 23 #undef IPC_MESSAGE_DECL
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 base::AutoLock locked(routes_lock_); 60 base::AutoLock locked(routes_lock_);
60 routes_.insert(routing_id); 61 routes_.insert(routing_id);
61 } 62 }
62 63
63 void InputEventFilter::DidRemoveInputHandler(int routing_id) { 64 void InputEventFilter::DidRemoveInputHandler(int routing_id) {
64 base::AutoLock locked(routes_lock_); 65 base::AutoLock locked(routes_lock_);
65 routes_.erase(routing_id); 66 routes_.erase(routing_id);
66 } 67 }
67 68
68 void InputEventFilter::DidOverscroll(int routing_id, 69 void InputEventFilter::DidOverscroll(int routing_id,
69 const cc::DidOverscrollParams& params) { 70 const DidOverscrollParams& params) {
70 if (!overscroll_notifications_enabled_) 71 if (!overscroll_notifications_enabled_)
71 return; 72 return;
72 73
74 // TODO(jdduke): Use |params| as the sole message argument, crbug/354444.
73 SendMessage(ViewHostMsg_DidOverscroll(routing_id, 75 SendMessage(ViewHostMsg_DidOverscroll(routing_id,
74 params.accumulated_overscroll, 76 params.accumulated_overscroll,
75 params.current_fling_velocity)); 77 params.current_fling_velocity));
76 } 78 }
77 79
78 void InputEventFilter::DidStopFlinging(int routing_id) { 80 void InputEventFilter::DidStopFlinging(int routing_id) {
79 SendMessage(ViewHostMsg_DidStopFlinging(routing_id)); 81 SendMessage(ViewHostMsg_DidStopFlinging(routing_id));
80 } 82 }
81 83
82 void InputEventFilter::OnFilterAdded(IPC::Channel* channel) { 84 void InputEventFilter::OnFilterAdded(IPC::Channel* channel) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) { 194 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) {
193 DCHECK(io_loop_->BelongsToCurrentThread()); 195 DCHECK(io_loop_->BelongsToCurrentThread());
194 196
195 if (!sender_) 197 if (!sender_)
196 return; // Filter was removed. 198 return; // Filter was removed.
197 199
198 sender_->Send(new IPC::Message(message)); 200 sender_->Send(new IPC::Message(message));
199 } 201 }
200 202
201 } // namespace content 203 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/input_event_filter.h ('k') | content/renderer/input/input_handler_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698