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

Side by Side Diff: mojo/ui/base_view.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « mojo/ui/base_view.h ('k') | mojo/ui/ganesh_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/ui/base_view.h" 5 #include "mojo/ui/base_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace ui { 10 namespace ui {
11 11
12 BaseView::BaseView( 12 BaseView::BaseView(
13 mojo::ApplicationImpl* app_impl, 13 mojo::ApplicationImpl* app_impl,
14 const std::string& label, 14 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
15 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback) 15 const std::string& label)
16 : app_impl_(app_impl), view_binding_(this) { 16 : app_impl_(app_impl), view_binding_(this) {
17 DCHECK(app_impl_); 17 DCHECK(app_impl_);
18 app_impl_->ConnectToService("mojo:view_manager_service", &view_manager_); 18 app_impl_->ConnectToService("mojo:view_manager_service", &view_manager_);
19 19
20 mojo::ui::ViewPtr view; 20 mojo::ui::ViewPtr view;
21 view_binding_.Bind(mojo::GetProxy(&view)); 21 view_binding_.Bind(mojo::GetProxy(&view));
22 view_manager_->RegisterView(view.Pass(), mojo::GetProxy(&view_host_), label, 22 view_manager_->RegisterView(view.Pass(), mojo::GetProxy(&view_host_),
23 create_view_callback); 23 view_owner_request.Pass(), label);
24 view_host_->CreateScene(mojo::GetProxy(&scene_)); 24 view_host_->CreateScene(mojo::GetProxy(&scene_));
25 view_host_->GetServiceProvider(mojo::GetProxy(&view_service_provider_)); 25 view_host_->GetServiceProvider(mojo::GetProxy(&view_service_provider_));
26 } 26 }
27 27
28 BaseView::~BaseView() {} 28 BaseView::~BaseView() {}
29 29
30 void BaseView::OnChildUnavailable(uint32_t child_key, 30 void BaseView::OnChildUnavailable(uint32_t child_key,
31 const OnChildUnavailableCallback& callback) { 31 const OnChildUnavailableCallback& callback) {
32 callback.Run(); 32 callback.Run();
33 } 33 }
34 34
35 } // namespace ui 35 } // namespace ui
36 } // namespace mojo 36 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/ui/base_view.h ('k') | mojo/ui/ganesh_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698