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

Side by Side Diff: services/ui/view_manager/view_stub.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments 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 | « services/ui/view_manager/view_stub.h ('k') | services/ui/view_manager/view_tree_host_impl.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/view_manager/view_stub.h" 5 #include "services/ui/view_manager/view_stub.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 #include "services/ui/view_manager/view_registry.h" 11 #include "services/ui/view_manager/view_registry.h"
10 #include "services/ui/view_manager/view_state.h" 12 #include "services/ui/view_manager/view_state.h"
11 #include "services/ui/view_manager/view_tree_state.h" 13 #include "services/ui/view_manager/view_tree_state.h"
12 14
13 namespace view_manager { 15 namespace view_manager {
14 16
15 ViewStub::ViewStub(ViewRegistry* registry, mojo::ui::ViewOwnerPtr owner) 17 ViewStub::ViewStub(ViewRegistry* registry,
16 : registry_(registry), owner_(owner.Pass()) { 18 mojo::InterfaceHandle<mojo::ui::ViewOwner> owner)
19 : registry_(registry),
20 owner_(mojo::ui::ViewOwnerPtr::Create(std::move(owner))) {
17 DCHECK(registry_); 21 DCHECK(registry_);
18 DCHECK(owner_); 22 DCHECK(owner_);
19 23
20 owner_.set_connection_error_handler( 24 owner_.set_connection_error_handler(
21 base::Bind(&ViewStub::OnViewResolved, base::Unretained(this), nullptr)); 25 base::Bind(&ViewStub::OnViewResolved, base::Unretained(this), nullptr));
22 owner_->GetToken( 26 owner_->GetToken(
23 base::Bind(&ViewStub::OnViewResolved, base::Unretained(this))); 27 base::Bind(&ViewStub::OnViewResolved, base::Unretained(this)));
24 } 28 }
25 29
26 ViewStub::~ViewStub() { 30 ViewStub::~ViewStub() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 93 }
90 } 94 }
91 95
92 void ViewStub::OnViewResolved(mojo::ui::ViewTokenPtr view_token) { 96 void ViewStub::OnViewResolved(mojo::ui::ViewTokenPtr view_token) {
93 DCHECK(owner_); 97 DCHECK(owner_);
94 owner_.reset(); 98 owner_.reset();
95 registry_->OnViewResolved(this, view_token.Pass()); 99 registry_->OnViewResolved(this, view_token.Pass());
96 } 100 }
97 101
98 } // namespace view_manager 102 } // namespace view_manager
OLDNEW
« no previous file with comments | « services/ui/view_manager/view_stub.h ('k') | services/ui/view_manager/view_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698