diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 20:44:38 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 20:44:38 +0000 |
commit | ac115ce69f13d5a25cac752b9e761198be478d51 (patch) | |
tree | 844bcbf1b993922333dc336e0c49f2f4683a8106 /remoting/host/continue_window.h | |
parent | 0306365d33a7cb7eee1f0c3315a98126af2cce35 (diff) | |
download | chromium_src-ac115ce69f13d5a25cac752b9e761198be478d51.zip chromium_src-ac115ce69f13d5a25cac752b9e761198be478d51.tar.gz chromium_src-ac115ce69f13d5a25cac752b9e761198be478d51.tar.bz2 |
The continue window is owned by the desktop environment now.
This CL completely removes HostUserInterface and It2MeHostUserInterface classes, making the desktop enviroment (It2MeDesktopEnvironment) responsible for creation of the UI. Platform-specific implementations of ContinueWindow have been rewritten on top of HostWindow class.
Collateral changes:
- HostScriptObject creates a instance of base::ThreadTaskRunnerHandle so that timers could run on the plugin thread.
- No more "uninteresting mock" messages caused by the continue and disconnect windows when running remoting_unittests.
BUG=104544
Review URL: https://chromiumcodereview.appspot.com/13461029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/continue_window.h')
-rw-r--r-- | remoting/host/continue_window.h | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/remoting/host/continue_window.h b/remoting/host/continue_window.h index fa1ae25..4b3bc75 100644 --- a/remoting/host/continue_window.h +++ b/remoting/host/continue_window.h @@ -5,30 +5,56 @@ #ifndef REMOTING_HOST_CONTINUE_WINDOW_H_ #define REMOTING_HOST_CONTINUE_WINDOW_H_ -#include "base/callback.h" +#include "base/basictypes.h" +#include "base/memory/weak_ptr.h" +#include "base/timer.h" +#include "remoting/host/host_window.h" +#include "remoting/host/ui_strings.h" namespace remoting { -struct UiStrings; - -class ContinueWindow { +class ContinueWindow : public HostWindow { public: - // ContinueSessionCallback is called when the user clicks on the - // Continue button to resume the session, or dismisses the window to - // terminate the session. This callback is provided as a parameter to the - // Show() method, and will be triggered on the UI thread. - typedef base::Callback<void(bool)> ContinueSessionCallback; + virtual ~ContinueWindow(); + + // HostWindow override. + virtual void Start( + const base::WeakPtr<ClientSessionControl>& client_session_control) + OVERRIDE; + + // Resumes paused client session. + void ContinueSession(); + + // Disconnects the client session. + void DisconnectSession(); + + protected: + explicit ContinueWindow(const UiStrings& ui_strings); + + // Shows and hides the UI. + virtual void ShowUi() = 0; + virtual void HideUi() = 0; + + const UiStrings& ui_strings() const { return ui_strings_; } + + private: + // Invoked periodically to ask for the local user whether the session should + // be continued. + void OnSessionExpired(); + + // Used to disconnect the client session. + base::WeakPtr<ClientSessionControl> client_session_control_; - virtual ~ContinueWindow() {} + // Used to disconnect the client session when timeout expires. + base::OneShotTimer<ContinueWindow> disconnect_timer_; - // Show the continuation window requesting that the user approve continuing - // the session. - virtual void Show(const ContinueSessionCallback& callback) = 0; + // Used to ask the local user whether the session should be continued. + base::OneShotTimer<ContinueWindow> session_expired_timer_; - // Hide the continuation window if it is visible. - virtual void Hide() = 0; + // Localized UI strings. + UiStrings ui_strings_; - static scoped_ptr<ContinueWindow> Create(const UiStrings* ui_strings); + DISALLOW_COPY_AND_ASSIGN(ContinueWindow); }; } // namespace remoting |