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 "remoting/client/plugin/pepper_input_handler.h" | 5 #include "remoting/client/plugin/pepper_input_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/cpp/image_data.h" | 8 #include "ppapi/cpp/image_data.h" |
9 #include "ppapi/cpp/input_event.h" | 9 #include "ppapi/cpp/input_event.h" |
10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 cursor_image_ = image.Pass(); | 211 cursor_image_ = image.Pass(); |
212 cursor_hotspot_ = hotspot; | 212 cursor_hotspot_ = hotspot; |
213 | 213 |
214 if (mouse_lock_state_ != MouseLockDisallowed && !cursor_image_) { | 214 if (mouse_lock_state_ != MouseLockDisallowed && !cursor_image_) { |
215 RequestMouseLock(); | 215 RequestMouseLock(); |
216 } else { | 216 } else { |
217 CancelMouseLock(); | 217 CancelMouseLock(); |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
| 221 void PepperInputHandler::HideMouseCursor() { |
| 222 cursor_image_.reset(); |
| 223 pp::MouseCursor::SetCursor(instance_, PP_MOUSECURSOR_TYPE_NONE); |
| 224 } |
| 225 |
221 void PepperInputHandler::MouseLockLost() { | 226 void PepperInputHandler::MouseLockLost() { |
222 DCHECK(mouse_lock_state_ == MouseLockOn || | 227 DCHECK(mouse_lock_state_ == MouseLockOn || |
223 mouse_lock_state_ == MouseLockCancelling); | 228 mouse_lock_state_ == MouseLockCancelling); |
224 | 229 |
225 mouse_lock_state_ = MouseLockOff; | 230 mouse_lock_state_ = MouseLockOff; |
226 UpdateMouseCursor(); | 231 UpdateMouseCursor(); |
227 } | 232 } |
228 | 233 |
229 void PepperInputHandler::RequestMouseLock() { | 234 void PepperInputHandler::RequestMouseLock() { |
230 // Request mouse lock only if the plugin is focused, the host-supplied cursor | 235 // Request mouse lock only if the plugin is focused, the host-supplied cursor |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 mouse_lock_state_ = MouseLockOff; | 305 mouse_lock_state_ = MouseLockOff; |
301 UpdateMouseCursor(); | 306 UpdateMouseCursor(); |
302 } | 307 } |
303 | 308 |
304 // Cancel as needed. | 309 // Cancel as needed. |
305 if (should_cancel) | 310 if (should_cancel) |
306 CancelMouseLock(); | 311 CancelMouseLock(); |
307 } | 312 } |
308 | 313 |
309 } // namespace remoting | 314 } // namespace remoting |
OLD | NEW |