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

Side by Side Diff: remoting/client/plugin/pepper_input_handler.h

Issue 296943003: Allow mouse-input to be enabled even if the plugin does not have keyboard focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 (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 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ppapi/cpp/mouse_lock.h" 10 #include "ppapi/cpp/mouse_lock.h"
(...skipping 26 matching lines...) Expand all
37 void AllowMouseLock(); 37 void AllowMouseLock();
38 38
39 // Called when the plugin receives or loses focus. 39 // Called when the plugin receives or loses focus.
40 void DidChangeFocus(bool has_focus); 40 void DidChangeFocus(bool has_focus);
41 41
42 // Sets the mouse cursor image. Passing NULL image will lock the mouse if 42 // Sets the mouse cursor image. Passing NULL image will lock the mouse if
43 // mouse lock is enabled. 43 // mouse lock is enabled.
44 void SetMouseCursor(scoped_ptr<pp::ImageData> image, 44 void SetMouseCursor(scoped_ptr<pp::ImageData> image,
45 const pp::Point& hotspot); 45 const pp::Point& hotspot);
46 46
47 // Enables sending input when the plugin does not have input focus.
Wez 2014/05/22 01:14:23 nit: mouse input
Jamie 2014/05/22 01:32:09 Done.
48 void SendMouseInputWhenUnfocused();
49
47 private: 50 private:
48 enum MouseLockState { 51 enum MouseLockState {
49 MouseLockDisallowed, 52 MouseLockDisallowed,
50 MouseLockOff, 53 MouseLockOff,
51 MouseLockRequestPending, 54 MouseLockRequestPending,
52 MouseLockOn, 55 MouseLockOn,
53 MouseLockCancelling 56 MouseLockCancelling
54 }; 57 };
55 58
56 // pp::MouseLock interface. 59 // pp::MouseLock interface.
(...skipping 22 matching lines...) Expand all
79 // the cursor image is completely transparent. This can be interpreted as 82 // the cursor image is completely transparent. This can be interpreted as
80 // a mouse lock request if enabled by the webapp. 83 // a mouse lock request if enabled by the webapp.
81 scoped_ptr<pp::ImageData> cursor_image_; 84 scoped_ptr<pp::ImageData> cursor_image_;
82 85
83 // Hot spot for |cursor_image_|. 86 // Hot spot for |cursor_image_|.
84 pp::Point cursor_hotspot_; 87 pp::Point cursor_hotspot_;
85 88
86 // True if the plugin has focus. 89 // True if the plugin has focus.
87 bool has_focus_; 90 bool has_focus_;
88 91
92 // True if the plugin should respond to mouse input even if it does not have
93 // keyboard focus.
94 bool send_mouse_input_when_unfocused_;
95
89 MouseLockState mouse_lock_state_; 96 MouseLockState mouse_lock_state_;
90 97
91 // Accumulated sub-pixel and sub-tick deltas from wheel events. 98 // Accumulated sub-pixel and sub-tick deltas from wheel events.
92 float wheel_delta_x_; 99 float wheel_delta_x_;
93 float wheel_delta_y_; 100 float wheel_delta_y_;
94 float wheel_ticks_x_; 101 float wheel_ticks_x_;
95 float wheel_ticks_y_; 102 float wheel_ticks_y_;
96 103
97 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler); 104 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler);
98 }; 105 };
99 106
100 } // namespace remoting 107 } // namespace remoting
101 108
102 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ 109 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698