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