| OLD | NEW |
| 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/browser/android/in_process/synchronous_input_event_filter.h" | 5 #include "content/browser/android/in_process/synchronous_input_event_filter.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "cc/input/input_handler.h" | 8 #include "cc/input/input_handler.h" |
| 9 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 9 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 void SynchronousInputEventFilter::SetBoundHandler(const Handler& handler) { | 35 void SynchronousInputEventFilter::SetBoundHandler(const Handler& handler) { |
| 36 BrowserThread::PostTask( | 36 BrowserThread::PostTask( |
| 37 BrowserThread::UI, FROM_HERE, | 37 BrowserThread::UI, FROM_HERE, |
| 38 base::Bind(&SynchronousInputEventFilter::SetBoundHandlerOnUIThread, | 38 base::Bind(&SynchronousInputEventFilter::SetBoundHandlerOnUIThread, |
| 39 base::Unretained(this), handler)); | 39 base::Unretained(this), handler)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void SynchronousInputEventFilter::SetBoundHandlerOnUIThread( | 42 void SynchronousInputEventFilter::SetBoundHandlerOnUIThread( |
| 43 const Handler& handler) { | 43 const Handler& handler) { |
| 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 44 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 45 handler_ = handler; | 45 handler_ = handler; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SynchronousInputEventFilter::DidAddInputHandler( | 48 void SynchronousInputEventFilter::DidAddInputHandler( |
| 49 int routing_id, | 49 int routing_id, |
| 50 cc::InputHandler* input_handler) { | 50 cc::InputHandler* input_handler) { |
| 51 // The SynchronusCompositorImpl can be NULL if the WebContents that it's | 51 // The SynchronusCompositorImpl can be NULL if the WebContents that it's |
| 52 // bound to has already been deleted. | 52 // bound to has already been deleted. |
| 53 SynchronousCompositorImpl* compositor = | 53 SynchronousCompositorImpl* compositor = |
| 54 SynchronousCompositorImpl::FromRoutingID(routing_id); | 54 SynchronousCompositorImpl::FromRoutingID(routing_id); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 void SynchronousInputEventFilter::DidStopFlinging(int routing_id) { | 79 void SynchronousInputEventFilter::DidStopFlinging(int routing_id) { |
| 80 // The SynchronusCompositorImpl can be NULL if the WebContents that it's | 80 // The SynchronusCompositorImpl can be NULL if the WebContents that it's |
| 81 // bound to has already been deleted. | 81 // bound to has already been deleted. |
| 82 SynchronousCompositorImpl* compositor = | 82 SynchronousCompositorImpl* compositor = |
| 83 SynchronousCompositorImpl::FromRoutingID(routing_id); | 83 SynchronousCompositorImpl::FromRoutingID(routing_id); |
| 84 if (compositor) | 84 if (compositor) |
| 85 compositor->DidStopFlinging(); | 85 compositor->DidStopFlinging(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace content | 88 } // namespace content |
| OLD | NEW |