| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <unistd.h> | 5 #include <unistd.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "mojo/application/application_runner_chromium.h" | 11 #include "mojo/environment/scoped_chromium_init.h" |
| 12 #include "mojo/public/c/system/main.h" | 12 #include "mojo/public/c/system/main.h" |
| 13 #include "mojo/public/cpp/application/connect.h" | 13 #include "mojo/public/cpp/application/connect.h" |
| 14 #include "mojo/public/cpp/application/run_application.h" |
| 14 #include "mojo/ui/choreographer.h" | 15 #include "mojo/ui/choreographer.h" |
| 15 #include "mojo/ui/ganesh_view.h" | 16 #include "mojo/ui/ganesh_view.h" |
| 16 #include "mojo/ui/input_handler.h" | 17 #include "mojo/ui/input_handler.h" |
| 17 #include "mojo/ui/view_provider_app.h" | 18 #include "mojo/ui/view_provider_app.h" |
| 18 #include "third_party/dejavu-fonts-ttf-2.34/kDejaVuSansMonoRegular.h" | 19 #include "third_party/dejavu-fonts-ttf-2.34/kDejaVuSansMonoRegular.h" |
| 19 #include "third_party/skia/include/core/SkCanvas.h" | 20 #include "third_party/skia/include/core/SkCanvas.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
| 21 #include "third_party/skia/include/core/SkRect.h" | 22 #include "third_party/skia/include/core/SkRect.h" |
| 22 #include "third_party/skia/include/core/SkStream.h" | 23 #include "third_party/skia/include/core/SkStream.h" |
| 23 #include "third_party/skia/include/core/SkTypeface.h" | 24 #include "third_party/skia/include/core/SkTypeface.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 204 |
| 204 class JankApp : public mojo::ui::ViewProviderApp { | 205 class JankApp : public mojo::ui::ViewProviderApp { |
| 205 public: | 206 public: |
| 206 JankApp() {} | 207 JankApp() {} |
| 207 ~JankApp() override {} | 208 ~JankApp() override {} |
| 208 | 209 |
| 209 void CreateView( | 210 void CreateView( |
| 210 const std::string& connection_url, | 211 const std::string& connection_url, |
| 211 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, | 212 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, |
| 212 mojo::InterfaceRequest<mojo::ServiceProvider> services) override { | 213 mojo::InterfaceRequest<mojo::ServiceProvider> services) override { |
| 213 new JankView(mojo::CreateApplicationConnector(app_impl()->shell()), | 214 new JankView(mojo::CreateApplicationConnector(shell()), |
| 214 view_owner_request.Pass()); | 215 view_owner_request.Pass()); |
| 215 } | 216 } |
| 216 | 217 |
| 217 private: | 218 private: |
| 218 DISALLOW_COPY_AND_ASSIGN(JankApp); | 219 DISALLOW_COPY_AND_ASSIGN(JankApp); |
| 219 }; | 220 }; |
| 220 | 221 |
| 221 } // namespace examples | 222 } // namespace examples |
| 222 | 223 |
| 223 MojoResult MojoMain(MojoHandle application_request) { | 224 MojoResult MojoMain(MojoHandle application_request) { |
| 224 mojo::ApplicationRunnerChromium runner(new examples::JankApp()); | 225 mojo::ScopedChromiumInit init; |
| 225 return runner.Run(application_request); | 226 examples::JankApp jank_app; |
| 227 return mojo::RunApplication(application_request, &jank_app); |
| 226 } | 228 } |
| OLD | NEW |