Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/input/blimp_input_handler_wrapper.h" | 5 #include "blimp/client/input/blimp_input_handler_wrapper.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/location.h" | 8 #include "base/location.h" | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "blimp/client/input/blimp_input_manager.h" | 10 #include "blimp/client/input/blimp_input_manager.h" | 
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 scoped_ptr<blink::WebInputEvent> input_event) { | 37 scoped_ptr<blink::WebInputEvent> input_event) { | 
| 38 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 38 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 
| 39 | 39 | 
| 40 // We might not have the input handler proxy anymore. | 40 // We might not have the input handler proxy anymore. | 
| 41 if (!input_handler_proxy_) | 41 if (!input_handler_proxy_) | 
| 42 return; | 42 return; | 
| 43 | 43 | 
| 44 ui::InputHandlerProxy::EventDisposition disposition = | 44 ui::InputHandlerProxy::EventDisposition disposition = | 
| 45 input_handler_proxy_->HandleInputEvent(*input_event); | 45 input_handler_proxy_->HandleInputEvent(*input_event); | 
| 46 | 46 | 
| 47 bool consumed = disposition == ui::InputHandlerProxy::DID_NOT_HANDLE; | 47 bool consumed; | 
| 
 
Wez
2016/01/15 20:58:18
Initialize consumed to false here!
 
Khushal
2016/01/15 21:03:21
Done.
 
 | |
| 48 | |
| 49 switch (disposition) { | |
| 50 case ui::InputHandlerProxy::EventDisposition::DID_HANDLE: | |
| 51 case ui::InputHandlerProxy::EventDisposition::DROP_EVENT: | |
| 52 consumed = true; | |
| 53 break; | |
| 54 case ui::InputHandlerProxy::EventDisposition::DID_NOT_HANDLE: | |
| 55 consumed = false; | |
| 
 
Wez
2016/01/15 20:58:18
nit: This case should have a break; even though it
 
Khushal
2016/01/15 21:03:21
Done.
 
 | |
| 56 } | |
| 48 | 57 | 
| 49 main_task_runner_->PostTask( | 58 main_task_runner_->PostTask( | 
| 50 FROM_HERE, | 59 FROM_HERE, | 
| 51 base::Bind(&BlimpInputManager::DidHandleWebInputEvent, | 60 base::Bind(&BlimpInputManager::DidHandleWebInputEvent, | 
| 52 input_manager_weak_ptr_, | 61 input_manager_weak_ptr_, | 
| 53 base::Passed(&input_event), consumed)); | 62 base::Passed(&input_event), consumed)); | 
| 54 } | 63 } | 
| 55 | 64 | 
| 56 void BlimpInputHandlerWrapper::WillShutdown() { | 65 void BlimpInputHandlerWrapper::WillShutdown() { | 
| 57 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 66 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 void BlimpInputHandlerWrapper::DidStopFlinging() { | 100 void BlimpInputHandlerWrapper::DidStopFlinging() { | 
| 92 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 101 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 
| 93 } | 102 } | 
| 94 | 103 | 
| 95 void BlimpInputHandlerWrapper::DidAnimateForInput() { | 104 void BlimpInputHandlerWrapper::DidAnimateForInput() { | 
| 96 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 105 DCHECK(compositor_thread_checker_.CalledOnValidThread()); | 
| 97 } | 106 } | 
| 98 | 107 | 
| 99 } // namespace client | 108 } // namespace client | 
| 100 } // namespace blimp | 109 } // namespace blimp | 
| OLD | NEW |