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

Unified Diff: remoting/host/host_window.cc

Issue 13212009: Made DesktopEnvironment responsible for creation of the disconnect window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux & Mac. Created 7 years, 9 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
Index: remoting/host/host_window.cc
diff --git a/remoting/host/host_window.cc b/remoting/host/host_window.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4d47a11429d333a536d395ead6a7cd431dee22f9
--- /dev/null
+++ b/remoting/host/host_window.cc
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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/host_window.h"
+
+#include "base/bind.h"
+#include "base/compiler_specific.h"
+#include "base/location.h"
+#include "base/logging.h"
+#include "base/single_thread_task_runner.h"
+#include "base/utf_string_conversions.h"
+
+namespace remoting {
+
+HostWindow::~HostWindow() {
+ core_->Stop();
+}
+
+HostWindow::Core::Core(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
+ const UiStrings& ui_strings)
+ : caller_task_runner_(caller_task_runner),
+ ui_task_runner_(ui_task_runner),
+ ui_strings_(ui_strings) {
+}
+
+void HostWindow::Core::Start() {
+ DCHECK(caller_task_runner_->BelongsToCurrentThread());
+
+ ui_task_runner_->PostTask(FROM_HERE,
+ base::Bind(&Core::StartOnUiThread, this));
+}
+
+void HostWindow::Core::Stop() {
+ DCHECK(caller_task_runner_->BelongsToCurrentThread());
+
+ ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::StopOnUiThread, this));
+}
+
+HostWindow::Core::~Core() {
+}
+
+HostWindow::HostWindow(scoped_refptr<Core> core)
+ : core_(core) {
+ core_->Start();
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698