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

Unified Diff: examples/bank_app/bank.cc

Issue 2012873003: More ApplicationDelegate/ApplicationRunner[Chromium] conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_run_app_options
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | examples/bank_app/customer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/bank_app/bank.cc
diff --git a/examples/bank_app/bank.cc b/examples/bank_app/bank.cc
index 4f96ecdc30f27e2cbe8ef69d8ebf39feb196296b..dec7814027344bf1ba864d5d56784cd374f987c4 100644
--- a/examples/bank_app/bank.cc
+++ b/examples/bank_app/bank.cc
@@ -2,15 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
-
#include "examples/bank_app/bank.mojom.h"
#include "mojo/common/binding_set.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
-#include "mojo/public/cpp/application/application_runner.h"
+#include "mojo/public/cpp/application/application_impl_base.h"
#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/utility/run_loop.h"
@@ -45,17 +42,17 @@ class BankUser {
std::string *user_;
};
-class BankApp : public mojo::ApplicationDelegate {
+class BankApp : public mojo::ApplicationImplBase {
public:
BankApp() {}
- void Initialize(mojo::ApplicationImpl* app) override {
- mojo::ConnectToService(app->shell(), "mojo:principal_service",
+ // ApplicationImplBase overrides:
+ void OnInitialize() override {
+ mojo::ConnectToService(shell(), "mojo:principal_service",
GetProxy(&login_service_));
}
- // From ApplicationDelegate
- bool ConfigureIncomingConnection(
+ bool OnAcceptConnection(
mojo::ServiceProviderImpl* service_provider_impl) override {
std::string url = service_provider_impl->connection_context().remote_url;
if (url.length() > 0) {
@@ -93,7 +90,6 @@ class BankApp : public mojo::ApplicationDelegate {
} // namespace examples
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<examples::BankApp>(new examples::BankApp()));
- return runner.Run(application_request);
+ examples::BankApp bank_app;
+ return mojo::RunMainApplication(application_request, &bank_app);
}
« no previous file with comments | « no previous file | examples/bank_app/customer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698