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

Unified Diff: mojo/services/window_manager/window_manager_service_impl.cc

Issue 396563002: Window Manager service.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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: mojo/services/window_manager/window_manager_service_impl.cc
diff --git a/mojo/services/window_manager/window_manager_service_impl.cc b/mojo/services/window_manager/window_manager_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..847e3fde9e0b7232a3b8c93aefb6bfc21feab812
--- /dev/null
+++ b/mojo/services/window_manager/window_manager_service_impl.cc
@@ -0,0 +1,56 @@
+// Copyright 2014 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 "mojo/services/window_manager/window_manager_service_impl.h"
+
+#include "mojo/services/window_manager/window_manager_app.h"
+
+namespace mojo {
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerServiceImpl, public:
+
+WindowManagerServiceImpl::WindowManagerServiceImpl(
+ ApplicationConnection* connection,
+ WindowManagerApp* window_manager)
+ : window_manager_(window_manager) {
+ window_manager_->AddConnection(this);
+}
+
+WindowManagerServiceImpl::~WindowManagerServiceImpl() {
+ window_manager_->RemoveConnection(this);
+}
+
+void WindowManagerServiceImpl::NotifyReady() {
+ client()->OnWindowManagerReady();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerServiceImpl, WindowManager implementation:
+
+void WindowManagerServiceImpl::OpenWindow(
+ const Callback<void(view_manager::Id)>& callback) {
+ view_manager::Id id = window_manager_->OpenWindow();
+ callback.Run(id);
+}
+
+void WindowManagerServiceImpl::SetCapture(
+ view_manager::Id node,
+ const Callback<void(bool)>& callback) {
+ window_manager_->SetCapture(node);
+ callback.Run(true);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerServiceImpl, InterfaceImpl overrides:
+
+void WindowManagerServiceImpl::OnConnectionEstablished() {
+ // If the connection was established prior to the window manager being
+ // embedded by the view manager, |window_manager_|'s ViewManagerDelegate
+ // impl will call NotifyReady() when it is.
+ if (window_manager_->IsReady())
+ NotifyReady();
+}
+
+} // namespace mojo
« no previous file with comments | « mojo/services/window_manager/window_manager_service_impl.h ('k') | mojo/services/window_manager/window_manager_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698