summaryrefslogtreecommitdiffstats
path: root/remoting/host/host_window.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-05 03:32:06 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-05 03:32:06 +0000
commitc308f512b3dd5008cf921d575ae669e340815ddf (patch)
tree94efaf22b1e990988098953c304863bf16e6afa4 /remoting/host/host_window.h
parentbfb172ea12179df8deaca7cbcd4a39bb2db04ef4 (diff)
downloadchromium_src-c308f512b3dd5008cf921d575ae669e340815ddf.zip
chromium_src-c308f512b3dd5008cf921d575ae669e340815ddf.tar.gz
chromium_src-c308f512b3dd5008cf921d575ae669e340815ddf.tar.bz2
Refactored the disconnect window such that it can be owned by the desktop environment.
This CL adds two new classes: HostWindow and HostWindowProxy. HostWindow is a non thread-safe base class for platform-specific implementations of the disconnect and continue windows. HostWindowProxy implements thread switching logic (using a ref-counted HostWindowProxy::Core). The combination of HostWindow and HostWindowProxy allows DesktopEnvironment to create the disconnect window on the network thread and run it on the UI thread. This is the 1st CL (out of 2) that deprecates the HostUserInterface class and moves responsibility to create the local UI to the corresponding DesktopEnvironment instances. The follow up CL will migrate the continue window logic. BUG=104544 Review URL: https://chromiumcodereview.appspot.com/13212009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/host_window.h')
-rw-r--r--remoting/host/host_window.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/remoting/host/host_window.h b/remoting/host/host_window.h
new file mode 100644
index 0000000..243f9ba
--- /dev/null
+++ b/remoting/host/host_window.h
@@ -0,0 +1,49 @@
+// Copyright 2013 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_HOST_WINDOW_H_
+#define REMOTING_HOST_HOST_WINDOW_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/non_thread_safe.h"
+
+namespace remoting {
+
+class ClientSessionControl;
+struct UiStrings;
+
+class HostWindow : public base::NonThreadSafe {
+ public:
+ virtual ~HostWindow() {}
+
+ // Creates a platform-specific instance of the continue window.
+ static scoped_ptr<HostWindow> CreateContinueWindow(
+ const UiStrings& ui_strings);
+
+ // Creates a platform-specific instance of the disconnect window.
+ static scoped_ptr<HostWindow> CreateDisconnectWindow(
+ const UiStrings& ui_strings);
+
+ // Starts the UI state machine. |client_session_control| will be used to
+ // notify the caller about the local user's actions.
+ virtual void Start(
+ const base::WeakPtr<ClientSessionControl>& client_session_control) = 0;
+
+ protected:
+ HostWindow() {}
+
+ private:
+ // Let |HostWindowProxy| to call DetachFromThread() when passing an instance
+ // of |HostWindow| to a different thread.
+ friend class HostWindowProxy;
+
+ DISALLOW_COPY_AND_ASSIGN(HostWindow);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_HOST_WINDOW_H_