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

Unified Diff: services/ui/view_manager/view_tree_host_impl.h

Issue 1415493003: mozart: Initial commit of the view manager. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « services/ui/view_manager/view_state.cc ('k') | services/ui/view_manager/view_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/view_manager/view_tree_host_impl.h
diff --git a/services/ui/view_manager/view_tree_host_impl.h b/services/ui/view_manager/view_tree_host_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..9677d8123fd72aa3c42eb00f9848e16201541bc6
--- /dev/null
+++ b/services/ui/view_manager/view_tree_host_impl.h
@@ -0,0 +1,49 @@
+// Copyright 2015 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 SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_
+#define SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/services/ui/views/interfaces/view_trees.mojom.h"
+#include "services/ui/view_manager/view_registry.h"
+#include "services/ui/view_manager/view_tree_state.h"
+
+namespace view_manager {
+
+// ViewTreeHost interface implementation.
+// This object is owned by its associated ViewTreeState.
+class ViewTreeHostImpl : public mojo::ui::ViewTreeHost {
+ public:
+ ViewTreeHostImpl(
+ ViewRegistry* registry,
+ ViewTreeState* state,
+ mojo::InterfaceRequest<mojo::ui::ViewTreeHost> view_tree_host_request);
+ ~ViewTreeHostImpl() override;
+
+ void set_view_tree_host_connection_error_handler(
+ const base::Closure& handler) {
+ binding_.set_connection_error_handler(handler);
+ }
+
+ private:
+ // |ViewTreeHost|:
+ void RequestLayout() override;
+ void SetRoot(uint32_t root_key,
+ mojo::ui::ViewTokenPtr root_view_token) override;
+ void ResetRoot() override;
+ void LayoutRoot(mojo::ui::ViewLayoutParamsPtr root_layout_params,
+ const LayoutRootCallback& callback) override;
+
+ ViewRegistry* const registry_;
+ ViewTreeState* const state_;
+ mojo::Binding<mojo::ui::ViewTreeHost> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewTreeHostImpl);
+};
+
+} // namespace view_manager
+
+#endif // SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_
« no previous file with comments | « services/ui/view_manager/view_state.cc ('k') | services/ui/view_manager/view_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698