Index: mojo/ui/base_view.cc |
diff --git a/mojo/ui/base_view.cc b/mojo/ui/base_view.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b58faf4104e0f0ef0138561587a0f7020763c35b |
--- /dev/null |
+++ b/mojo/ui/base_view.cc |
@@ -0,0 +1,36 @@ |
+// 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. |
+ |
+#include "mojo/ui/base_view.h" |
+ |
+#include "base/logging.h" |
+ |
+namespace mojo { |
+namespace ui { |
+ |
+BaseView::BaseView( |
+ mojo::ApplicationImpl* app_impl, |
+ const std::string& label, |
+ const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback) |
+ : app_impl_(app_impl), view_binding_(this) { |
+ DCHECK(app_impl_); |
+ app_impl_->ConnectToService("mojo:view_manager_service", &view_manager_); |
+ |
+ mojo::ui::ViewPtr view; |
+ view_binding_.Bind(mojo::GetProxy(&view)); |
+ view_manager_->RegisterView(view.Pass(), mojo::GetProxy(&view_host_), label, |
+ create_view_callback); |
+ view_host_->CreateScene(mojo::GetProxy(&scene_)); |
+ view_host_->GetServiceProvider(mojo::GetProxy(&view_service_provider_)); |
+} |
+ |
+BaseView::~BaseView() {} |
+ |
+void BaseView::OnChildUnavailable(uint32_t child_key, |
+ const OnChildUnavailableCallback& callback) { |
+ callback.Run(); |
+} |
+ |
+} // namespace ui |
+} // namespace mojo |