OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "cc/input/input_handler.h" | 10 #include "cc/input/input_handler.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const cc::DidOverscrollParams& params) { | 52 const cc::DidOverscrollParams& params) { |
53 DCHECK(target_loop_->BelongsToCurrentThread()); | 53 DCHECK(target_loop_->BelongsToCurrentThread()); |
54 | 54 |
55 if (!overscroll_notifications_enabled_) | 55 if (!overscroll_notifications_enabled_) |
56 return; | 56 return; |
57 | 57 |
58 io_loop_->PostTask( | 58 io_loop_->PostTask( |
59 FROM_HERE, | 59 FROM_HERE, |
60 base::Bind(&InputEventFilter::SendMessageOnIOThread, this, | 60 base::Bind(&InputEventFilter::SendMessageOnIOThread, this, |
61 ViewHostMsg_DidOverscroll(routing_id, | 61 ViewHostMsg_DidOverscroll(routing_id, |
62 params.accumulated_overscroll, | 62 params.accumulated_overscroll))); |
63 params.current_fling_velocity))); | |
64 } | 63 } |
65 | 64 |
66 void InputEventFilter::OnFilterAdded(IPC::Channel* channel) { | 65 void InputEventFilter::OnFilterAdded(IPC::Channel* channel) { |
67 io_loop_ = base::MessageLoopProxy::current(); | 66 io_loop_ = base::MessageLoopProxy::current(); |
68 sender_ = channel; | 67 sender_ = channel; |
69 } | 68 } |
70 | 69 |
71 void InputEventFilter::OnFilterRemoved() { | 70 void InputEventFilter::OnFilterRemoved() { |
72 sender_ = NULL; | 71 sender_ = NULL; |
73 } | 72 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) { | 163 void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) { |
165 DCHECK(io_loop_->BelongsToCurrentThread()); | 164 DCHECK(io_loop_->BelongsToCurrentThread()); |
166 | 165 |
167 if (!sender_) | 166 if (!sender_) |
168 return; // Filter was removed. | 167 return; // Filter was removed. |
169 | 168 |
170 sender_->Send(new IPC::Message(message)); | 169 sender_->Send(new IPC::Message(message)); |
171 } | 170 } |
172 | 171 |
173 } // namespace content | 172 } // namespace content |
OLD | NEW |