| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_delegate.h" | 11 #include "mojo/public/cpp/application/application_delegate.h" |
| 11 #include "mojo/public/cpp/application/application_impl.h" | 12 #include "mojo/public/cpp/application/application_impl.h" |
| 13 #include "mojo/public/cpp/application/application_runner.h" |
| 12 #include "mojo/public/cpp/environment/environment.h" | 14 #include "mojo/public/cpp/environment/environment.h" |
| 13 #include "mojo/public/cpp/system/core.h" | 15 #include "mojo/public/cpp/system/core.h" |
| 14 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" |
| 15 #include "mojo/services/dbus_echo/echo.mojom.h" | 17 #include "mojo/services/dbus_echo/echo.mojom.h" |
| 16 | 18 |
| 17 namespace mojo { | 19 namespace mojo { |
| 18 namespace examples { | 20 namespace examples { |
| 19 | 21 |
| 20 class DBusEchoApp : public ApplicationDelegate { | 22 class DBusEchoApp : public ApplicationDelegate { |
| 21 public: | 23 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 void OnEcho(String echoed) { | 37 void OnEcho(String echoed) { |
| 36 LOG(INFO) << "echo'd " << echoed; | 38 LOG(INFO) << "echo'd " << echoed; |
| 37 } | 39 } |
| 38 | 40 |
| 39 EchoServicePtr echo_service_; | 41 EchoServicePtr echo_service_; |
| 40 | 42 |
| 41 DISALLOW_COPY_AND_ASSIGN(DBusEchoApp); | 43 DISALLOW_COPY_AND_ASSIGN(DBusEchoApp); |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 } // namespace examples | 46 } // namespace examples |
| 47 } // namespace mojo |
| 45 | 48 |
| 46 // static | 49 MojoResult MojoMain(MojoHandle shell_handle) { |
| 47 ApplicationDelegate* ApplicationDelegate::Create() { | 50 mojo::ApplicationRunner runner(new mojo::examples::DBusEchoApp); |
| 48 return new examples::DBusEchoApp(); | 51 return runner.Run(shell_handle); |
| 49 } | 52 } |
| 50 | |
| 51 } // namespace mojo | |
| OLD | NEW |