| 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 #ifndef MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ | 5 #ifndef MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ |
| 6 #define MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ | 6 #define MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 10 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void RunApplication( | 47 void RunApplication( |
| 48 InterfaceRequest<shell::mojom::Application> application_request, | 48 InterfaceRequest<shell::mojom::Application> application_request, |
| 49 URLResponsePtr response) override; | 49 URLResponsePtr response) override; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 explicit ContentHandlerFactory(Delegate* delegate); | 52 explicit ContentHandlerFactory(Delegate* delegate); |
| 53 ~ContentHandlerFactory() override; | 53 ~ContentHandlerFactory() override; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // From InterfaceFactory: | 56 // From InterfaceFactory: |
| 57 void Create(ApplicationConnection* connection, | 57 void Create(Connection* connection, |
| 58 InterfaceRequest<shell::mojom::ContentHandler> request) override; | 58 InterfaceRequest<shell::mojom::ContentHandler> request) override; |
| 59 | 59 |
| 60 Delegate* delegate_; | 60 Delegate* delegate_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(ContentHandlerFactory); | 62 DISALLOW_COPY_AND_ASSIGN(ContentHandlerFactory); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 template <class A> | 65 template <class A> |
| 66 class HandledApplicationHolderImpl | 66 class HandledApplicationHolderImpl |
| 67 : public ContentHandlerFactory::HandledApplicationHolder { | 67 : public ContentHandlerFactory::HandledApplicationHolder { |
| 68 public: | 68 public: |
| 69 explicit HandledApplicationHolderImpl(A* value) : value_(value) {} | 69 explicit HandledApplicationHolderImpl(A* value) : value_(value) {} |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 scoped_ptr<A> value_; | 72 scoped_ptr<A> value_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 template <class A> | 75 template <class A> |
| 76 scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> | 76 scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> |
| 77 make_handled_factory_holder(A* value) { | 77 make_handled_factory_holder(A* value) { |
| 78 return make_scoped_ptr(new HandledApplicationHolderImpl<A>(value)); | 78 return make_scoped_ptr(new HandledApplicationHolderImpl<A>(value)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace mojo | 81 } // namespace mojo |
| 82 | 82 |
| 83 #endif // MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ | 83 #endif // MOJO_SHELL_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_ |
| OLD | NEW |