continue_window.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_CONTINUE_WINDOW_H_
  5. #define REMOTING_HOST_CONTINUE_WINDOW_H_
  6. #include "base/memory/weak_ptr.h"
  7. #include "base/timer/timer.h"
  8. #include "remoting/host/host_window.h"
  9. namespace remoting {
  10. class ContinueWindow : public HostWindow {
  11. public:
  12. ContinueWindow(const ContinueWindow&) = delete;
  13. ContinueWindow& operator=(const ContinueWindow&) = delete;
  14. ~ContinueWindow() override;
  15. // HostWindow override.
  16. void Start(const base::WeakPtr<ClientSessionControl>& client_session_control)
  17. override;
  18. // Resumes paused client session.
  19. void ContinueSession();
  20. // Disconnects the client session.
  21. void DisconnectSession();
  22. protected:
  23. ContinueWindow();
  24. // Shows and hides the UI.
  25. virtual void ShowUi() = 0;
  26. virtual void HideUi() = 0;
  27. private:
  28. // Invoked periodically to ask for the local user whether the session should
  29. // be continued.
  30. void OnSessionExpired();
  31. // Used to disconnect the client session.
  32. base::WeakPtr<ClientSessionControl> client_session_control_;
  33. // Used to disconnect the client session when timeout expires.
  34. base::OneShotTimer disconnect_timer_;
  35. // Used to ask the local user whether the session should be continued.
  36. base::OneShotTimer session_expired_timer_;
  37. };
  38. } // namespace remoting
  39. #endif // REMOTING_HOST_CONTINUE_WINDOW_H_