summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-16 21:25:34 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-16 21:25:34 +0000
commit38a4d77a5de086f4e4ec77482bfd05655fa42bb4 (patch)
tree76aa511002953ccaf7705bdd6a48a456b36514be
parent3d5c8589c346c44381fa84121d1dc6cfc047d02c (diff)
downloadchromium_src-38a4d77a5de086f4e4ec77482bfd05655fa42bb4.zip
chromium_src-38a4d77a5de086f4e4ec77482bfd05655fa42bb4.tar.gz
chromium_src-38a4d77a5de086f4e4ec77482bfd05655fa42bb4.tar.bz2
Interface and stubs for continuation window.
BUG=None TEST=None Review URL: http://codereview.chromium.org/7003160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89401 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/host/chromoting_host.cc5
-rw-r--r--remoting/host/chromoting_host_unittest.cc5
-rw-r--r--remoting/host/continue_window.h28
-rw-r--r--remoting/host/continue_window_linux.cc36
-rw-r--r--remoting/host/continue_window_mac.mm36
-rw-r--r--remoting/host/continue_window_win.cc36
-rw-r--r--remoting/host/desktop_environment.cc5
-rw-r--r--remoting/host/desktop_environment.h7
-rw-r--r--remoting/host/host_mock_objects.cc8
-rw-r--r--remoting/host/host_mock_objects.h10
-rw-r--r--remoting/host/simple_host_process.cc6
-rw-r--r--remoting/remoting.gyp8
12 files changed, 186 insertions, 4 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index ace4f71..457072d 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -11,6 +11,7 @@
#include "remoting/base/encoder_vp8.h"
#include "remoting/host/capturer.h"
#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/continue_window.h"
#include "remoting/host/curtain.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/disconnect_window.h"
@@ -42,10 +43,12 @@ ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context,
EventExecutor::Create(context->ui_message_loop(), capturer);
Curtain* curtain = Curtain::Create();
DisconnectWindow* disconnect_window = DisconnectWindow::Create();
+ ContinueWindow* continue_window = ContinueWindow::Create();
LocalInputMonitor* local_input_monitor = LocalInputMonitor::Create();
return Create(context, config,
new DesktopEnvironment(capturer, event_executor, curtain,
- disconnect_window, local_input_monitor),
+ disconnect_window, continue_window,
+ local_input_monitor),
access_verifier);
}
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 9f1e2e5..6856e51 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -95,10 +95,12 @@ class ChromotingHostTest : public testing::Test {
event_executor_ = new MockEventExecutor();
curtain_ = new MockCurtain();
disconnect_window_ = new MockDisconnectWindow();
+ continue_window_ = new MockContinueWindow();
local_input_monitor_ = new MockLocalInputMonitor();
DesktopEnvironment* desktop =
new DesktopEnvironment(capturer, event_executor_, curtain_,
- disconnect_window_, local_input_monitor_);
+ disconnect_window_, continue_window_,
+ local_input_monitor_);
MockAccessVerifier* access_verifier = new MockAccessVerifier();
host_ = ChromotingHost::Create(&context_, config_,
@@ -222,6 +224,7 @@ class ChromotingHostTest : public testing::Test {
MockEventExecutor* event_executor_;
MockCurtain* curtain_;
MockDisconnectWindow* disconnect_window_;
+ ContinueWindow* continue_window_;
MockLocalInputMonitor* local_input_monitor_;
};
diff --git a/remoting/host/continue_window.h b/remoting/host/continue_window.h
new file mode 100644
index 0000000..0c52416
--- /dev/null
+++ b/remoting/host/continue_window.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_CONTINUE_WINDOW_H
+#define REMOTING_HOST_CONTINUE_WINDOW_H
+
+namespace remoting {
+
+class ChromotingHost;
+
+class ContinueWindow {
+ public:
+ virtual ~ContinueWindow() {}
+
+ // Show the continuation window requesting that the user approve continuing
+ // the session.
+ virtual void Show(ChromotingHost* host) = 0;
+
+ // Hide the continuation window if it is visible.
+ virtual void Hide() = 0;
+
+ static ContinueWindow* Create();
+};
+
+}
+
+#endif // REMOTING_HOST_CONTINUE_WINDOW_H
diff --git a/remoting/host/continue_window_linux.cc b/remoting/host/continue_window_linux.cc
new file mode 100644
index 0000000..3b7d9d7
--- /dev/null
+++ b/remoting/host/continue_window_linux.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/continue_window.h"
+
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+
+namespace remoting {
+
+class ContinueWindowLinux : public remoting::ContinueWindow {
+ public:
+ ContinueWindowLinux() {}
+ virtual ~ContinueWindowLinux() {}
+
+ virtual void Show(remoting::ChromotingHost* host) OVERRIDE;
+ virtual void Hide() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ContinueWindowLinux);
+};
+
+void ContinueWindowLinux::Show(remoting::ChromotingHost* host) {
+ NOTIMPLEMENTED();
+}
+
+void ContinueWindowLinux::Hide() {
+ NOTIMPLEMENTED();
+}
+
+ContinueWindow* ContinueWindow::Create() {
+ return new ContinueWindowLinux();
+}
+
+} // namespace remoting
diff --git a/remoting/host/continue_window_mac.mm b/remoting/host/continue_window_mac.mm
new file mode 100644
index 0000000..2dab025
--- /dev/null
+++ b/remoting/host/continue_window_mac.mm
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "remoting/host/continue_window.h"
+
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+
+namespace remoting {
+
+class ContinueWindowMac : public remoting::ContinueWindow {
+ public:
+ ContinueWindowMac() {}
+ virtual ~ContinueWindowMac() {}
+
+ virtual void Show(remoting::ChromotingHost* host) OVERRIDE;
+ virtual void Hide() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ContinueWindowMac);
+};
+
+void ContinueWindowMac::Show(remoting::ChromotingHost* host) {
+ NOTIMPLEMENTED();
+}
+
+void ContinueWindowMac::Hide() {
+ NOTIMPLEMENTED();
+}
+
+ContinueWindow* ContinueWindow::Create() {
+ return new ContinueWindowMac();
+}
+
+} // namespace remoting
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc
new file mode 100644
index 0000000..7fe70ab
--- /dev/null
+++ b/remoting/host/continue_window_win.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/continue_window.h"
+
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+
+namespace remoting {
+
+class ContinueWindowWin : public remoting::ContinueWindow {
+ public:
+ ContinueWindowWin() {}
+ virtual ~ContinueWindowWin() {}
+
+ virtual void Show(remoting::ChromotingHost* host) OVERRIDE;
+ virtual void Hide() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ContinueWindowWin);
+};
+
+void ContinueWindowWin::Show(remoting::ChromotingHost* host) {
+ NOTIMPLEMENTED();
+}
+
+void ContinueWindowWin::Hide() {
+ NOTIMPLEMENTED();
+}
+
+ContinueWindow* ContinueWindow::Create() {
+ return new ContinueWindowWin();
+}
+
+} // namespace remoting
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc
index 6a2ff03..84e6d6d 100644
--- a/remoting/host/desktop_environment.cc
+++ b/remoting/host/desktop_environment.cc
@@ -5,9 +5,10 @@
#include "remoting/host/desktop_environment.h"
#include "remoting/host/capturer.h"
+#include "remoting/host/continue_window.h"
#include "remoting/host/curtain.h"
-#include "remoting/host/event_executor.h"
#include "remoting/host/disconnect_window.h"
+#include "remoting/host/event_executor.h"
#include "remoting/host/local_input_monitor.h"
namespace remoting {
@@ -16,11 +17,13 @@ DesktopEnvironment::DesktopEnvironment(Capturer* capturer,
EventExecutor* event_executor,
Curtain* curtain,
DisconnectWindow* disconnect_window,
+ ContinueWindow* continue_window,
LocalInputMonitor* local_input_monitor)
: capturer_(capturer),
event_executor_(event_executor),
curtain_(curtain),
disconnect_window_(disconnect_window),
+ continue_window_(continue_window),
local_input_monitor_(local_input_monitor) {
}
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 4182645..b029a2a 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -11,6 +11,7 @@
namespace remoting {
class Capturer;
+class ContinueWindow;
class Curtain;
class DisconnectWindow;
class EventExecutor;
@@ -21,6 +22,7 @@ class DesktopEnvironment {
// DesktopEnvironment takes ownership of all the objects passed the ctor.
DesktopEnvironment(Capturer* capturer, EventExecutor* event_executor,
Curtain* curtain, DisconnectWindow* disconnect_window,
+ ContinueWindow* continue_window,
LocalInputMonitor* monitor);
virtual ~DesktopEnvironment();
@@ -28,6 +30,7 @@ class DesktopEnvironment {
EventExecutor* event_executor() const { return event_executor_.get(); }
Curtain* curtain() const { return curtain_.get(); }
DisconnectWindow* disconnect_window() { return disconnect_window_.get(); }
+ ContinueWindow* continue_window() { return continue_window_.get(); }
LocalInputMonitor* local_input_monitor() {
return local_input_monitor_.get();
}
@@ -45,6 +48,10 @@ class DesktopEnvironment {
// Provide a user interface allowing the host user to close the connection.
scoped_ptr<DisconnectWindow> disconnect_window_;
+ // 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_;
diff --git a/remoting/host/host_mock_objects.cc b/remoting/host/host_mock_objects.cc
index c3bc0ed..de0ea97 100644
--- a/remoting/host/host_mock_objects.cc
+++ b/remoting/host/host_mock_objects.cc
@@ -30,6 +30,14 @@ DisconnectWindow* DisconnectWindow::Create() {
return new MockDisconnectWindow();
}
+MockContinueWindow::MockContinueWindow() {}
+
+MockContinueWindow::~MockContinueWindow() {}
+
+ContinueWindow* ContinueWindow::Create() {
+ return new MockContinueWindow();
+}
+
MockLocalInputMonitor::MockLocalInputMonitor() {}
MockLocalInputMonitor::~MockLocalInputMonitor() {}
diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h
index c4090d3..0ab8636f 100644
--- a/remoting/host/host_mock_objects.h
+++ b/remoting/host/host_mock_objects.h
@@ -10,6 +10,7 @@
#include "remoting/host/curtain.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/client_session.h"
+#include "remoting/host/continue_window.h"
#include "remoting/host/disconnect_window.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/local_input_monitor.h"
@@ -63,6 +64,15 @@ class MockLocalInputMonitor : public LocalInputMonitor {
MOCK_METHOD0(Stop, void());
};
+class MockContinueWindow : public ContinueWindow {
+ public:
+ MockContinueWindow();
+ virtual ~MockContinueWindow();
+
+ MOCK_METHOD1(Show, void(remoting::ChromotingHost* host));
+ MOCK_METHOD0(Hide, void());
+};
+
class MockChromotingHostContext : public ChromotingHostContext {
public:
MockChromotingHostContext();
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index d62d49b..85f3aa8 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -38,6 +38,7 @@
#include "remoting/host/capturer_fake.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/continue_window.h"
#include "remoting/host/curtain.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/disconnect_window.h"
@@ -187,12 +188,15 @@ class SimpleHost {
remoting::Curtain* curtain = remoting::Curtain::Create();
remoting::DisconnectWindow* disconnect_window =
remoting::DisconnectWindow::Create();
+ remoting::ContinueWindow* continue_window =
+ remoting::ContinueWindow::Create();
remoting::LocalInputMonitor* local_input_monitor =
remoting::LocalInputMonitor::Create();
host = ChromotingHost::Create(
&context, config,
new DesktopEnvironment(capturer, event_executor, curtain,
- disconnect_window, local_input_monitor),
+ disconnect_window, continue_window,
+ local_input_monitor),
access_verifier.release());
} else {
host = ChromotingHost::Create(&context, config,
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 755d532..cfac8f1 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -166,6 +166,10 @@
'../third_party/npapi/npapi.gyp:npapi',
],
'sources': [
+ 'host/continue_window.h',
+ 'host/continue_window_mac.mm',
+ 'host/continue_window_linux.cc',
+ 'host/continue_window_win.cc',
'host/disconnect_window_linux.cc',
'host/disconnect_window_mac.h',
'host/disconnect_window_mac.mm',
@@ -481,6 +485,10 @@
'sources': [
'host/capturer_fake_ascii.cc',
'host/capturer_fake_ascii.h',
+ 'host/continue_window.h',
+ 'host/continue_window_mac.mm',
+ 'host/continue_window_linux.cc',
+ 'host/continue_window_win.cc',
'host/disconnect_window_linux.cc',
'host/disconnect_window_mac.h',
'host/disconnect_window_mac.mm',