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

Side by Side Diff: examples/bank_app/bank.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (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
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 <memory> 5 #include <memory>
6 6
7 #include "examples/bank_app/bank.mojom.h" 7 #include "examples/bank_app/bank.mojom.h"
8 #include "mojo/common/binding_set.h" 8 #include "mojo/common/binding_set.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 private: 44 private:
45 std::string *user_; 45 std::string *user_;
46 }; 46 };
47 47
48 class BankApp : public mojo::ApplicationDelegate, 48 class BankApp : public mojo::ApplicationDelegate,
49 public mojo::InterfaceFactory<Bank> { 49 public mojo::InterfaceFactory<Bank> {
50 public: 50 public:
51 BankApp() { 51 BankApp() {
52 } 52 }
53 void Initialize(mojo::ApplicationImpl* app) override { 53 void Initialize(mojo::ApplicationImpl* app) override {
54 app->ConnectToService("mojo:principal_service", &login_service_); 54 app->ConnectToServiceDeprecated("mojo:principal_service", &login_service_);
55 } 55 }
56 56
57 // From ApplicationDelegate 57 // From ApplicationDelegate
58 bool ConfigureIncomingConnection( 58 bool ConfigureIncomingConnection(
59 mojo::ApplicationConnection* connection) override { 59 mojo::ApplicationConnection* connection) override {
60 std::string url = connection->GetRemoteApplicationURL(); 60 std::string url = connection->GetRemoteApplicationURL();
61 if (url.length() > 0) { 61 if (url.length() > 0) {
62 vanadium::AppInstanceNamePtr app(vanadium::AppInstanceName::New()); 62 vanadium::AppInstanceNamePtr app(vanadium::AppInstanceName::New());
63 app->url = url; 63 app->url = url;
64 std::string user; 64 std::string user;
(...skipping 26 matching lines...) Expand all
91 vanadium::PrincipalServicePtr login_service_; 91 vanadium::PrincipalServicePtr login_service_;
92 }; 92 };
93 93
94 } // namespace examples 94 } // namespace examples
95 95
96 MojoResult MojoMain(MojoHandle application_request) { 96 MojoResult MojoMain(MojoHandle application_request) {
97 mojo::ApplicationRunner runner( 97 mojo::ApplicationRunner runner(
98 std::unique_ptr<examples::BankApp>(new examples::BankApp())); 98 std::unique_ptr<examples::BankApp>(new examples::BankApp()));
99 return runner.Run(application_request); 99 return runner.Run(application_request);
100 } 100 }
OLDNEW
« no previous file with comments | « examples/authentication_demo/google_authentication_demo.cc ('k') | examples/bank_app/customer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698