OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef REMOTING_HOST_SESSION_CONTROLLER_H_ | 5 #ifndef REMOTING_HOST_SESSION_CONTROLLER_H_ |
6 #define REMOTING_HOST_SESSION_CONTROLLER_H_ | 6 #define REMOTING_HOST_SESSION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "remoting/host/mouse_move_observer.h" | |
10 #include "third_party/skia/include/core/SkPoint.h" | 9 #include "third_party/skia/include/core/SkPoint.h" |
11 #include "third_party/skia/include/core/SkSize.h" | 10 #include "third_party/skia/include/core/SkSize.h" |
12 | 11 |
13 namespace remoting { | 12 namespace remoting { |
14 | 13 |
15 class ScreenResolution; | 14 class ScreenResolution; |
16 | 15 |
16 // The SessionController interface should be implemented by objects | |
17 // (representing some aspects of the desktop environment) that can control | |
Sergey Ulanov
2013/03/20 17:23:31
nit: drop the parentheses
alexeypa (please no reviews)
2013/03/20 17:34:31
Done.
| |
18 // the client session (disconnect, pause, or block the remote input). | |
19 // | |
20 // Objects implementing SessionController are created by | |
21 // DektopEnvironment::CreateSessionController() method. They are created after | |
22 // a client session has been authenticated and destroyed along with the session. | |
23 // | |
24 // The desired screen resolution of is also selected via SessionController. | |
25 // Strictly speaking, it could be implemented via a separate interface. Adding | |
26 // it here however saves us lots of hassle with adding another CreateXxx() | |
27 // method to all implementations of DesktopEnvironment (eight at the moment of | |
Sergey Ulanov
2013/03/20 17:23:31
nit: no need to be so wordy about it - maybe remov
alexeypa (please no reviews)
2013/03/20 17:34:31
Done.
| |
28 // writing). | |
17 class SessionController { | 29 class SessionController { |
18 public: | 30 public: |
19 // TODO(alexeypa): remove MouseMoveObserver entirely and move | 31 // Provides nobs for controlling the client session. |
20 // OnLocalMouseMoved() method to SessionController::Delegate. | 32 class Delegate { |
21 // See http://crbug.com/104544. | |
22 class Delegate : public MouseMoveObserver { | |
23 public: | 33 public: |
24 virtual ~Delegate() {} | 34 virtual ~Delegate() {} |
25 | 35 |
26 // Disconnects the client session, tears down transport resources and stops | 36 // Disconnects the client session, tears down transport resources and stops |
27 // scheduler components. | 37 // scheduler components. |
28 virtual void DisconnectSession() = 0; | 38 virtual void DisconnectSession() = 0; |
29 | 39 |
30 // Called when local mouse movement is detected. | 40 // Called when local mouse movement is detected. |
31 virtual void OnLocalMouseMoved(const SkIPoint& position) = 0; | 41 virtual void OnLocalMouseMoved(const SkIPoint& position) = 0; |
42 | |
43 // Pauses or resumes the session. | |
44 virtual void PauseSession(bool pause) = 0; | |
32 }; | 45 }; |
33 | 46 |
34 virtual ~SessionController() {} | 47 virtual ~SessionController() {} |
35 | 48 |
36 // Attempts to set new screen resolution in the session. | 49 // Attempts to set new screen resolution in the session. |
37 virtual void SetScreenResolution(const ScreenResolution& resolution) = 0; | 50 virtual void SetScreenResolution(const ScreenResolution& resolution) {} |
38 }; | 51 }; |
39 | 52 |
40 } // namespace remoting | 53 } // namespace remoting |
41 | 54 |
42 #endif // REMOTING_HOST_SESSION_CONTROLLER_H_ | 55 #endif // REMOTING_HOST_SESSION_CONTROLLER_H_ |
OLD | NEW |