OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/values.h" | 6 #include "base/values.h" |
7 #include "examples/recipes/recipe_handler/recipe_factory.h" | 7 #include "examples/recipes/recipe_handler/recipe_factory.h" |
8 #include "examples/recipes/recipe_handler/recipe_impl.h" | 8 #include "examples/recipes/recipe_handler/recipe_impl.h" |
9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
10 #include "mojo/application/content_handler_factory.h" | 10 #include "mojo/application/content_handler_factory.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class RecipeHandlerApp : public mojo::ApplicationDelegate, | 23 class RecipeHandlerApp : public mojo::ApplicationDelegate, |
24 public mojo::ContentHandlerFactory::ManagedDelegate { | 24 public mojo::ContentHandlerFactory::ManagedDelegate { |
25 public: | 25 public: |
26 RecipeHandlerApp() : content_handler_factory_(this) {} | 26 RecipeHandlerApp() : content_handler_factory_(this) {} |
27 | 27 |
28 ~RecipeHandlerApp() override {} | 28 ~RecipeHandlerApp() override {} |
29 | 29 |
30 private: | 30 private: |
31 // Overridden from ApplicationDelegate: | 31 // Overridden from ApplicationDelegate: |
32 bool ConfigureIncomingConnection( | 32 bool ConfigureIncomingConnection( |
33 mojo::ApplicationConnection* connection) override { | 33 mojo::ApplicationConnection* connection, const std::string& url) override
{ |
34 connection->AddService(&content_handler_factory_); | 34 connection->AddService(&content_handler_factory_); |
35 return true; | 35 return true; |
36 } | 36 } |
37 | 37 |
38 // Overridden from ContentHandlerFactory::ManagedDelegate: | 38 // Overridden from ContentHandlerFactory::ManagedDelegate: |
39 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> | 39 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> |
40 CreateApplication( | 40 CreateApplication( |
41 mojo::InterfaceRequest<mojo::Application> application_request, | 41 mojo::InterfaceRequest<mojo::Application> application_request, |
42 mojo::URLResponsePtr response) override { | 42 mojo::URLResponsePtr response) override { |
43 std::string recipe_string; | 43 std::string recipe_string; |
(...skipping 30 matching lines...) Expand all Loading... |
74 }; | 74 }; |
75 | 75 |
76 } // namespace recipe_handler | 76 } // namespace recipe_handler |
77 } // namespace recipes | 77 } // namespace recipes |
78 | 78 |
79 MojoResult MojoMain(MojoHandle shell_handle) { | 79 MojoResult MojoMain(MojoHandle shell_handle) { |
80 mojo::ApplicationRunnerChromium runner( | 80 mojo::ApplicationRunnerChromium runner( |
81 new recipes::recipe_handler::RecipeHandlerApp()); | 81 new recipes::recipe_handler::RecipeHandlerApp()); |
82 return runner.Run(shell_handle); | 82 return runner.Run(shell_handle); |
83 } | 83 } |
OLD | NEW |