| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/macros.h" |
| 6 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
| 7 #include "mojo/examples/wm_flow/app/embedder.mojom.h" | 8 #include "mojo/examples/wm_flow/app/embedder.mojom.h" |
| 8 #include "mojo/examples/wm_flow/embedded/embeddee.mojom.h" | 9 #include "mojo/examples/wm_flow/embedded/embeddee.mojom.h" |
| 9 #include "mojo/public/c/system/main.h" | 10 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 11 #include "mojo/public/cpp/application/application_connection.h" |
| 11 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 12 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 13 #include "mojo/public/cpp/application/connect.h" | 14 #include "mojo/public/cpp/application/connect.h" |
| 14 #include "mojo/public/cpp/application/interface_factory_impl.h" | 15 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 15 #include "mojo/public/cpp/application/service_provider_impl.h" | 16 #include "mojo/public/cpp/application/service_provider_impl.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 26 | 27 |
| 27 const SkColor kColors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorYELLOW }; | 28 const SkColor kColors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorYELLOW }; |
| 28 | 29 |
| 29 class EmbedderImpl : public mojo::InterfaceImpl<Embedder> { | 30 class EmbedderImpl : public mojo::InterfaceImpl<Embedder> { |
| 30 public: | 31 public: |
| 31 EmbedderImpl() {} | 32 EmbedderImpl() {} |
| 32 virtual ~EmbedderImpl() {} | 33 virtual ~EmbedderImpl() {} |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 // Overridden from Embedder: | 36 // Overridden from Embedder: |
| 36 virtual void HelloWorld(const mojo::Callback<void()>& callback) OVERRIDE { | 37 virtual void HelloWorld(const mojo::Callback<void()>& callback) override { |
| 37 callback.Run(); | 38 callback.Run(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 DISALLOW_COPY_AND_ASSIGN(EmbedderImpl); | 41 DISALLOW_COPY_AND_ASSIGN(EmbedderImpl); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace | 44 } // namespace |
| 44 | 45 |
| 45 // This app starts its life via Connect() rather than by being embed, so it does | 46 // This app starts its life via Connect() rather than by being embed, so it does |
| 46 // not start with a connection to the ViewManager service. It has to obtain a | 47 // not start with a connection to the ViewManager service. It has to obtain a |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 DISALLOW_COPY_AND_ASSIGN(WMFlowApp); | 130 DISALLOW_COPY_AND_ASSIGN(WMFlowApp); |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 } // namespace examples | 133 } // namespace examples |
| 133 | 134 |
| 134 MojoResult MojoMain(MojoHandle shell_handle) { | 135 MojoResult MojoMain(MojoHandle shell_handle) { |
| 135 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp); | 136 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp); |
| 136 return runner.Run(shell_handle); | 137 return runner.Run(shell_handle); |
| 137 } | 138 } |
| OLD | NEW |