summaryrefslogtreecommitdiffstats
path: root/components/mus/public/cpp/window_tree_connection.h
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2015-10-15 17:12:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-16 00:13:20 +0000
commit68afcf453d29c8f311b34a0aa210e042d4adc132 (patch)
tree5d7e25e02abe745aec485ecb4450f37d24b080c8 /components/mus/public/cpp/window_tree_connection.h
parentda33ab883a2046613836487d852d5fd36f1dc4c3 (diff)
downloadchromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.zip
chromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.tar.gz
chromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.tar.bz2
View => Window in components/mus/public/cpp
This CL updates the client lib to refer to mus::Windows and mus::WindowServer instead of View and View Manager. I hope I caught everything. I'll clean things up in subsequent CLs, and start renaming the interfaces and implementation. BUG=542848 Review URL: https://codereview.chromium.org/1402223003 Cr-Commit-Position: refs/heads/master@{#354411}
Diffstat (limited to 'components/mus/public/cpp/window_tree_connection.h')
-rw-r--r--components/mus/public/cpp/window_tree_connection.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/components/mus/public/cpp/window_tree_connection.h b/components/mus/public/cpp/window_tree_connection.h
new file mode 100644
index 0000000..d677b2a
--- /dev/null
+++ b/components/mus/public/cpp/window_tree_connection.h
@@ -0,0 +1,70 @@
+// 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.
+
+#ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_
+#define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_
+
+#include <string>
+
+#include "components/mus/public/cpp/types.h"
+#include "components/mus/public/interfaces/view_tree.mojom.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
+
+#if defined(OS_WIN)
+// Windows headers define a macro for CreateWindow.
+#if defined(CreateWindow)
+#undef CreateWindow
+#endif
+#endif
+
+namespace mus {
+
+class Window;
+class WindowTreeDelegate;
+
+// Encapsulates a connection to a view tree. A unique connection is made
+// every time an app is embedded.
+class WindowTreeConnection {
+ public:
+ enum class CreateType {
+ // Indicates Create() should wait for OnEmbed(). If true, the
+ // WindowTreeConnection returned from Create() will have its root, otherwise
+ // the WindowTreeConnection will get the root at a later time.
+ WAIT_FOR_EMBED,
+ DONT_WAIT_FOR_EMBED
+ };
+
+ virtual ~WindowTreeConnection() {}
+
+ // The returned WindowTreeConnection instance owns itself, and is deleted when
+ // the last root is destroyed or the connection to the service is broken.
+ static WindowTreeConnection* Create(
+ WindowTreeDelegate* delegate,
+ mojo::InterfaceRequest<mojo::ViewTreeClient> request,
+ CreateType create_type);
+
+ // Returns the root of this connection.
+ virtual Window* GetRoot() = 0;
+
+ // Returns a View known to this connection.
+ virtual Window* GetWindowById(Id id) = 0;
+
+ // Returns the focused view; null if focus is not yet known or another app is
+ // focused.
+ virtual Window* GetFocusedWindow() = 0;
+
+ // Creates and returns a new View (which is owned by the ViewManager). Views
+ // are initially hidden, use SetVisible(true) to show.
+ virtual Window* CreateWindow() = 0;
+
+ // Returns true if ACCESS_POLICY_EMBED_ROOT was specified.
+ virtual bool IsEmbedRoot() = 0;
+
+ // Returns the id for this connection.
+ virtual ConnectionSpecificId GetConnectionId() = 0;
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_