desktop_session.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_HOST_DESKTOP_SESSION_H_
  5. #define REMOTING_HOST_DESKTOP_SESSION_H_
  6. #include "base/compiler_specific.h"
  7. #include "base/memory/raw_ptr.h"
  8. namespace remoting {
  9. class DaemonProcess;
  10. class ScreenResolution;
  11. // Represents the desktop session for a connected terminal. Each desktop session
  12. // has a unique identifier used by cross-platform code to refer to it.
  13. class DesktopSession {
  14. public:
  15. DesktopSession(const DesktopSession&) = delete;
  16. DesktopSession& operator=(const DesktopSession&) = delete;
  17. virtual ~DesktopSession();
  18. // Changes the screen resolution of the desktop session.
  19. virtual void SetScreenResolution(const ScreenResolution& resolution) = 0;
  20. int id() const { return id_; }
  21. protected:
  22. // Creates a terminal and assigns a unique identifier to it. |daemon_process|
  23. // must outlive |this|.
  24. DesktopSession(DaemonProcess* daemon_process, int id);
  25. DaemonProcess* daemon_process() const { return daemon_process_; }
  26. private:
  27. // The owner of |this|.
  28. const raw_ptr<DaemonProcess> daemon_process_;
  29. // A unique identifier of the terminal.
  30. const int id_;
  31. };
  32. } // namespace remoting
  33. #endif // REMOTING_HOST_DESKTOP_SESSION_H_