Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: remoting/host/it2me_host_user_interface.h

Issue 10384127: Chromoting: the Me2me host now presents a notification on the console allowing a user to disconnect… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Unix-line endings. The license text. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/host_user_interface.cc ('k') | remoting/host/it2me_host_user_interface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me_host_user_interface.h
diff --git a/remoting/host/it2me_host_user_interface.h b/remoting/host/it2me_host_user_interface.h
index 897ddd7e728571ae3225971388dcfc4ec6967c95..b054c653983fd637de4b295ff5f8c071db4107a0 100644
--- a/remoting/host/it2me_host_user_interface.h
+++ b/remoting/host/it2me_host_user_interface.h
@@ -8,110 +8,68 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "remoting/base/scoped_thread_proxy.h"
-#include "remoting/host/host_status_observer.h"
-
-// Milliseconds before the continue window is shown.
-static const int kContinueWindowShowTimeoutMs = 10 * 60 * 1000;
-
-// Milliseconds before the continue window is automatically dismissed and
-// the connection is closed.
-static const int kContinueWindowHideTimeoutMs = 60 * 1000;
+#include "remoting/host/host_user_interface.h"
namespace remoting {
-class ChromotingHost;
-class ChromotingHostContext;
class ContinueWindow;
-class DisconnectWindow;
-class LocalInputMonitor;
-class SignalStrategy;
// This class implements the IT2Me-specific parts of the ChromotingHost:
// Disconnect and Continue window popups.
// IT2Me-specific handling of multiple connection attempts.
-class It2MeHostUserInterface : public HostStatusObserver {
+class It2MeHostUserInterface : public HostUserInterface {
public:
- It2MeHostUserInterface(ChromotingHost* host, ChromotingHostContext* context);
+ It2MeHostUserInterface(ChromotingHostContext* context);
virtual ~It2MeHostUserInterface();
- void Init();
+ virtual void Start(ChromotingHost* host,
+ const base::Closure& disconnect_callback) OVERRIDE;
// HostStatusObserver implementation. These methods will be called from the
// network thread.
virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
- virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
- virtual void OnAccessDenied(const std::string& jid) OVERRIDE;
- virtual void OnShutdown() OVERRIDE;
- // Shuts down the object and all its resources synchronously. Must
- // be called on the UI thread.
- void Shutdown();
+ protected:
+ virtual void ProcessOnClientAuthenticated(
+ const std::string& username) OVERRIDE;
+ virtual void ProcessOnClientDisconnected() OVERRIDE;
private:
class TimerTask;
- // Allow ChromotingHostTest::SetUp() to call InitFrom().
+ // Allow ChromotingHostTest::SetUp() to call StartForTest().
friend class ChromotingHostTest;
- // Used by unit-tests as an alternative to Init() so that mock versions of
+ // Used by unit-tests as an alternative to Start() so that mock versions of
// internal objects can be used.
- void InitFrom(scoped_ptr<DisconnectWindow> disconnect_window,
- scoped_ptr<ContinueWindow> continue_window,
- scoped_ptr<LocalInputMonitor> monitor);
-
- void ProcessOnClientAuthenticated(const std::string& username);
- void ProcessOnClientDisconnected();
-
- void MonitorLocalInputs(bool enable);
-
- // Show or hide the Disconnect window on the UI thread. If |show| is false,
- // hide the window, ignoring the |username| parameter.
- void ShowDisconnectWindow(bool show, const std::string& username);
-
- // Show or hide the Continue Sharing window on the UI thread.
- void ShowContinueWindow(bool show);
+ void StartForTest(
+ ChromotingHost* host,
+ const base::Closure& disconnect_callback,
+ scoped_ptr<DisconnectWindow> disconnect_window,
+ scoped_ptr<ContinueWindow> continue_window,
+ scoped_ptr<LocalInputMonitor> local_input_monitor);
// Called by the ContinueWindow implementation (on the UI thread) when the
// user dismisses the Continue prompt.
void ContinueSession(bool continue_session);
-
- void StartContinueWindowTimer(bool start);
-
void OnContinueWindowTimer();
void OnShutdownHostTimer();
- ChromotingHost* host_;
-
- // Host context used to make sure operations are run on the correct thread.
- // This is owned by the ChromotingHost.
- ChromotingHostContext* context_;
-
- // Provide a user interface allowing the host user to close the connection.
- scoped_ptr<DisconnectWindow> disconnect_window_;
+ // Show or hide the Continue Sharing window on the UI thread.
+ void ShowContinueWindow(bool show);
+ void StartContinueWindowTimer(bool start);
// Provide a user interface requiring the user to periodically re-confirm
// the connection.
scoped_ptr<ContinueWindow> continue_window_;
- // Monitor local inputs to allow remote inputs to be blocked while the local
- // user is trying to do something.
- scoped_ptr<LocalInputMonitor> local_input_monitor_;
-
- bool is_monitoring_local_inputs_;
-
// Timer controlling the "continue session" dialog.
scoped_ptr<TimerTask> timer_task_;
- ScopedThreadProxy ui_thread_proxy_;
-
- // The JID of the currently-authenticated user (or an empty string if no user
- // is connected).
- std::string authenticated_jid_;
-
DISALLOW_COPY_AND_ASSIGN(It2MeHostUserInterface);
};
« no previous file with comments | « remoting/host/host_user_interface.cc ('k') | remoting/host/it2me_host_user_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698