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

Side by Side Diff: examples/moterm_example_app/moterm_example_app.cc

Issue 2001283002: Remove ViewProvider.CreateView()'s exposed_services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 | « apps/moterm/moterm_app.cc ('k') | examples/shadows/shadows_app.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 // This is a simple example application (with an embeddable view), which embeds 5 // This is a simple example application (with an embeddable view), which embeds
6 // the Moterm view, uses it to prompt the user, etc. 6 // the Moterm view, uses it to prompt the user, etc.
7 7
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request) 51 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request)
52 : shell_(shell), weak_factory_(this) { 52 : shell_(shell), weak_factory_(this) {
53 // Connect to the moterm app. 53 // Connect to the moterm app.
54 LOG(INFO) << "Connecting to moterm"; 54 LOG(INFO) << "Connecting to moterm";
55 mojo::ServiceProviderPtr moterm_app; 55 mojo::ServiceProviderPtr moterm_app;
56 shell->ConnectToApplication("mojo:moterm", GetProxy(&moterm_app), nullptr); 56 shell->ConnectToApplication("mojo:moterm", GetProxy(&moterm_app), nullptr);
57 57
58 // Create the moterm view and pass it back to the client directly. 58 // Create the moterm view and pass it back to the client directly.
59 mojo::ConnectToService(moterm_app.get(), GetProxy(&moterm_view_provider_)); 59 mojo::ConnectToService(moterm_app.get(), GetProxy(&moterm_view_provider_));
60 mojo::ServiceProviderPtr moterm_service_provider; 60 mojo::ServiceProviderPtr moterm_service_provider;
61 moterm_view_provider_->CreateView( 61 moterm_view_provider_->CreateView(view_owner_request.Pass(),
62 view_owner_request.Pass(), GetProxy(&moterm_service_provider), nullptr); 62 GetProxy(&moterm_service_provider));
63 63
64 // Connect to the moterm terminal service associated with the view 64 // Connect to the moterm terminal service associated with the view
65 // we just created. 65 // we just created.
66 mojo::ConnectToService(moterm_service_provider.get(), 66 mojo::ConnectToService(moterm_service_provider.get(),
67 GetProxy(&moterm_terminal_)); 67 GetProxy(&moterm_terminal_));
68 68
69 // Start running. 69 // Start running.
70 StartPrompt(true); 70 StartPrompt(true);
71 } 71 }
72 72
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 class MotermExampleApp : public mojo::ui::ViewProviderApp { 159 class MotermExampleApp : public mojo::ui::ViewProviderApp {
160 public: 160 public:
161 MotermExampleApp() {} 161 MotermExampleApp() {}
162 ~MotermExampleApp() override {} 162 ~MotermExampleApp() override {}
163 163
164 // |ViewProviderApp|: 164 // |ViewProviderApp|:
165 void CreateView( 165 void CreateView(
166 const std::string& connection_url, 166 const std::string& connection_url,
167 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 167 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
168 mojo::InterfaceRequest<mojo::ServiceProvider> services, 168 mojo::InterfaceRequest<mojo::ServiceProvider> services) override {
169 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) override {
170 new MotermExampleAppView(app_impl()->shell(), view_owner_request.Pass()); 169 new MotermExampleAppView(app_impl()->shell(), view_owner_request.Pass());
171 } 170 }
172 171
173 private: 172 private:
174 DISALLOW_COPY_AND_ASSIGN(MotermExampleApp); 173 DISALLOW_COPY_AND_ASSIGN(MotermExampleApp);
175 }; 174 };
176 175
177 MojoResult MojoMain(MojoHandle application_request) { 176 MojoResult MojoMain(MojoHandle application_request) {
178 mojo::ApplicationRunnerChromium runner(new MotermExampleApp()); 177 mojo::ApplicationRunnerChromium runner(new MotermExampleApp());
179 return runner.Run(application_request); 178 return runner.Run(application_request);
180 } 179 }
OLDNEW
« no previous file with comments | « apps/moterm/moterm_app.cc ('k') | examples/shadows/shadows_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698