#include "base/bind.h"
#include "base/logging.h"
+#include "mojo/examples/echo/echo_service.mojom.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/environment/environment.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
-#include "mojo/services/dbus_echo/echo.mojom.h"
namespace mojo {
namespace examples {
app->ConnectToService(
"dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_);
- echo_service_->Echo(
+ echo_service_->EchoString(
String::From("who"),
base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this)));
}
};
} // namespace examples
+} // namespace mojo
-// static
-ApplicationDelegate* ApplicationDelegate::Create() {
- return new examples::DBusEchoApp();
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunner runner(new mojo::examples::DBusEchoApp);
+ return runner.Run(shell_handle);
}
-
-} // namespace mojo