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

Side by Side Diff: mojo/ui/view_provider_app.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
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/view_provider_app.h" 5 #include "mojo/ui/view_provider_app.h"
6 6
7 #include <utility>
8
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 11
10 namespace mojo { 12 namespace mojo {
11 namespace ui { 13 namespace ui {
12 14
13 class ViewProviderApp::DelegatingViewProvider : public mojo::ui::ViewProvider { 15 class ViewProviderApp::DelegatingViewProvider : public mojo::ui::ViewProvider {
14 public: 16 public:
15 DelegatingViewProvider(ViewProviderApp* app, 17 DelegatingViewProvider(ViewProviderApp* app,
16 const std::string& view_provider_url) 18 const std::string& view_provider_url)
17 : app_(app), view_provider_url_(view_provider_url) {} 19 : app_(app), view_provider_url_(view_provider_url) {}
18 20
19 ~DelegatingViewProvider() override {} 21 ~DelegatingViewProvider() override {}
20 22
21 private: 23 private:
22 // |ViewProvider|: 24 // |ViewProvider|:
23 void CreateView( 25 void CreateView(
24 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 26 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
25 mojo::InterfaceRequest<mojo::ServiceProvider> services, 27 mojo::InterfaceRequest<mojo::ServiceProvider> services,
26 mojo::ServiceProviderPtr exposed_services) override { 28 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) override {
27 app_->CreateView(this, view_provider_url_, view_owner_request.Pass(), 29 app_->CreateView(this, view_provider_url_, view_owner_request.Pass(),
28 services.Pass(), exposed_services.Pass()); 30 services.Pass(), std::move(exposed_services));
29 } 31 }
30 32
31 ViewProviderApp* app_; 33 ViewProviderApp* app_;
32 std::string view_provider_url_; 34 std::string view_provider_url_;
33 35
34 MOJO_DISALLOW_COPY_AND_ASSIGN(DelegatingViewProvider); 36 MOJO_DISALLOW_COPY_AND_ASSIGN(DelegatingViewProvider);
35 }; 37 };
36 38
37 ViewProviderApp::ViewProviderApp() {} 39 ViewProviderApp::ViewProviderApp() {}
38 40
(...skipping 21 matching lines...) Expand all
60 bindings_.AddBinding( 62 bindings_.AddBinding(
61 new DelegatingViewProvider(this, connection->GetConnectionURL()), 63 new DelegatingViewProvider(this, connection->GetConnectionURL()),
62 request.Pass()); 64 request.Pass());
63 } 65 }
64 66
65 void ViewProviderApp::CreateView( 67 void ViewProviderApp::CreateView(
66 DelegatingViewProvider* provider, 68 DelegatingViewProvider* provider,
67 const std::string& view_provider_url, 69 const std::string& view_provider_url,
68 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 70 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
69 mojo::InterfaceRequest<mojo::ServiceProvider> services, 71 mojo::InterfaceRequest<mojo::ServiceProvider> services,
70 mojo::ServiceProviderPtr exposed_services) { 72 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) {
71 CreateView(view_provider_url, view_owner_request.Pass(), services.Pass(), 73 CreateView(view_provider_url, view_owner_request.Pass(), services.Pass(),
72 exposed_services.Pass()); 74 exposed_services.Pass());
73 } 75 }
74 76
75 } // namespace ui 77 } // namespace ui
76 } // namespace mojo 78 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698