| 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 #ifndef REMOTING_HOST_DESKTOP_SESSION_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_H_ |
| 6 #define REMOTING_HOST_DESKTOP_SESSION_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "third_party/skia/include/core/SkPoint.h" | |
| 11 #include "third_party/skia/include/core/SkSize.h" | |
| 12 | 10 |
| 13 namespace remoting { | 11 namespace remoting { |
| 14 | 12 |
| 15 class DaemonProcess; | 13 class DaemonProcess; |
| 16 | 14 |
| 17 // This structure describes parameters required to create a desktop session. | |
| 18 struct DesktopSessionParams { | |
| 19 DesktopSessionParams(); | |
| 20 | |
| 21 // Vertical and horizontal DPI of the remote screen. The caller should pass | |
| 22 // (0, 0) if DPI of the remote screen is not known. The default 96 DPI will be | |
| 23 // assumed in that case. | |
| 24 SkIPoint client_dpi_; | |
| 25 | |
| 26 // Resolution of the remote screen in pixels. The caller should pass (0, 0) if | |
| 27 // resolution of the remote screen size in not known. | |
| 28 SkISize client_size_; | |
| 29 }; | |
| 30 | |
| 31 // Represents the desktop session for a connected terminal. Each desktop session | 15 // Represents the desktop session for a connected terminal. Each desktop session |
| 32 // has a unique identifier used by cross-platform code to refer to it. | 16 // has a unique identifier used by cross-platform code to refer to it. |
| 33 class DesktopSession { | 17 class DesktopSession { |
| 34 public: | 18 public: |
| 35 virtual ~DesktopSession(); | 19 virtual ~DesktopSession(); |
| 36 | 20 |
| 37 int id() const { return id_; } | 21 int id() const { return id_; } |
| 38 | 22 |
| 39 protected: | 23 protected: |
| 40 // Creates a terminal and assigns a unique identifier to it. |daemon_process| | 24 // Creates a terminal and assigns a unique identifier to it. |daemon_process| |
| 41 // must outlive |this|. | 25 // must outlive |this|. |
| 42 DesktopSession(DaemonProcess* daemon_process, int id); | 26 DesktopSession(DaemonProcess* daemon_process, int id); |
| 43 | 27 |
| 44 DaemonProcess* daemon_process() const { return daemon_process_; } | 28 DaemonProcess* daemon_process() const { return daemon_process_; } |
| 45 | 29 |
| 46 private: | 30 private: |
| 47 // The owner of |this|. | 31 // The owner of |this|. |
| 48 DaemonProcess* const daemon_process_; | 32 DaemonProcess* const daemon_process_; |
| 49 | 33 |
| 50 // A unique identifier of the terminal. | 34 // A unique identifier of the terminal. |
| 51 const int id_; | 35 const int id_; |
| 52 | 36 |
| 53 DISALLOW_COPY_AND_ASSIGN(DesktopSession); | 37 DISALLOW_COPY_AND_ASSIGN(DesktopSession); |
| 54 }; | 38 }; |
| 55 | 39 |
| 56 } // namespace remoting | 40 } // namespace remoting |
| 57 | 41 |
| 58 #endif // REMOTING_HOST_DESKTOP_SESSION_H_ | 42 #endif // REMOTING_HOST_DESKTOP_SESSION_H_ |
| OLD | NEW |