Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / mojo / examples / dbus_echo / dbus_echo_app.cc
index ea18f8b..7a76f71 100644 (file)
@@ -7,12 +7,14 @@
 
 #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 {
@@ -26,7 +28,7 @@ class DBusEchoApp : public ApplicationDelegate {
     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)));
   }
@@ -42,10 +44,9 @@ class DBusEchoApp : public ApplicationDelegate {
 };
 
 }  // 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