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

Unified Diff: remoting/host/client_session.h

Issue 9465035: Move ClientSession's input logic into separate components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge authenticated and awaiting-continue states. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session.h
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index 31ac0793dcf81b0cabad117c7bb91d8a37800aa5..303cf1fa8ddce3303aa31c3913b20c07cf463fe3 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -6,13 +6,13 @@
#define REMOTING_HOST_CLIENT_SESSION_H_
#include <list>
-#include <set>
#include "base/time.h"
#include "base/threading/non_thread_safe.h"
#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
+#include "remoting/protocol/key_event_tracker.h"
#include "third_party/skia/include/core/SkPoint.h"
namespace remoting {
@@ -93,14 +93,6 @@ class ClientSession : public protocol::HostStub,
return connection_.get();
}
- bool authenticated() const {
- return authenticated_;
- }
-
- void set_awaiting_continue_approval(bool awaiting) {
- awaiting_continue_approval_ = awaiting;
- }
-
const std::string& client_jid() { return client_jid_; }
// Indicate that local mouse activity has been detected. This causes remote
@@ -108,15 +100,18 @@ class ClientSession : public protocol::HostStub,
// have the upper hand in 'pointer wars'.
void LocalMouseMoved(const SkIPoint& new_pos);
- bool ShouldIgnoreRemoteMouseInput(const protocol::MouseEvent& event) const;
- bool ShouldIgnoreRemoteKeyboardInput(const protocol::KeyEvent& event) const;
+ // Disable handling of input events from this client. If the client has any
+ // keys or mouse buttons pressed then these will be released.
+ void SetDisableInputs(bool disable_inputs);
private:
friend class ClientSessionTest_RestoreEventState_Test;
Jamie 2012/03/15 18:38:56 Should this be the appropriate ALL_PREFIXES macro?
Wez 2012/03/15 22:25:29 Actually, I don't think it's required at all. Rem
- // Keep track of input state so that we can clean up the event queue when
+ // Returns whether input should be ignored because of local activity.
+ bool ShouldIgnoreInput() const;
+
+ // Keep track of mouse state so that we can clean up the event queue when
// the user disconnects.
- void RecordKeyEvent(const protocol::KeyEvent& event);
void RecordMouseButtonState(const protocol::MouseEvent& event);
// Synthesize KeyUp and MouseUp events so that we can undo these events
@@ -130,8 +125,8 @@ class ClientSession : public protocol::HostStub,
std::string client_jid_;
- // The input stub to which this object delegates.
- protocol::InputStub* input_stub_;
+ // Key event tracker used to release pressed keys when disconnecting.
+ protocol::KeyEventTracker key_tracker_;
// Capturer, used to determine current screen size for ensuring injected
// mouse events fall within the screen area.
@@ -139,12 +134,8 @@ class ClientSession : public protocol::HostStub,
// area, out of this class (crbug.com/96508).
Capturer* capturer_;
- // Whether this client is authenticated.
- bool authenticated_;
-
- // Whether or not inputs from this client are blocked pending approval from
- // the host user to continue the connection.
- bool awaiting_continue_approval_;
+ // Whether or not input events from the client should be processed.
+ bool disable_inputs_;
// State to control remote input blocking while the local pointer is in use.
uint32 remote_mouse_button_state_;
@@ -160,10 +151,6 @@ class ClientSession : public protocol::HostStub,
base::Time latest_local_input_time_;
- // Set of keys that are currently pressed down by the user. This is used so
- // we can release them if the user disconnects.
- std::set<int> pressed_keys_;
-
DISALLOW_COPY_AND_ASSIGN(ClientSession);
};

Powered by Google App Engine
This is Rietveld 408576698