OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mojo/ui/base_view.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace mojo { |
| 10 namespace ui { |
| 11 |
| 12 BaseView::BaseView( |
| 13 mojo::ApplicationImpl* app_impl, |
| 14 const std::string& label, |
| 15 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback) |
| 16 : app_impl_(app_impl), view_binding_(this) { |
| 17 DCHECK(app_impl_); |
| 18 app_impl_->ConnectToService("mojo:view_manager_service", &view_manager_); |
| 19 |
| 20 mojo::ui::ViewPtr view; |
| 21 view_binding_.Bind(mojo::GetProxy(&view)); |
| 22 view_manager_->RegisterView(view.Pass(), mojo::GetProxy(&view_host_), label, |
| 23 create_view_callback); |
| 24 view_host_->CreateScene(mojo::GetProxy(&scene_)); |
| 25 view_host_->GetServiceProvider(mojo::GetProxy(&view_service_provider_)); |
| 26 } |
| 27 |
| 28 BaseView::~BaseView() {} |
| 29 |
| 30 void BaseView::OnChildUnavailable(uint32_t child_key, |
| 31 const OnChildUnavailableCallback& callback) { |
| 32 callback.Run(); |
| 33 } |
| 34 |
| 35 } // namespace ui |
| 36 } // namespace mojo |
OLD | NEW |