| 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_ANDROID_CONTENT_HANDLER_H_ | 5 #ifndef MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_ |
| 6 #define MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_ | 6 #define MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/single_thread_task_runner.h" |
| 10 #include "mojo/application/content_handler_factory.h" | 11 #include "mojo/application/content_handler_factory.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/interface_factory_impl.h" | 13 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 13 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" | 14 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" |
| 15 #include "mojo/services/url_response_disk_cache/public/interfaces/url_response_d
isk_cache.mojom.h" |
| 14 #include "shell/android/intent_receiver_manager_factory.h" | 16 #include "shell/android/intent_receiver_manager_factory.h" |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 class FilePath; | 19 class FilePath; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace shell { | 22 namespace shell { |
| 21 | 23 |
| 22 class AndroidHandler : public mojo::ApplicationDelegate, | 24 class AndroidHandler : public mojo::ApplicationDelegate, |
| 23 public mojo::ContentHandlerFactory::Delegate { | 25 public mojo::ContentHandlerFactory::Delegate { |
| 24 public: | 26 public: |
| 25 AndroidHandler(); | 27 AndroidHandler(); |
| 26 ~AndroidHandler(); | 28 ~AndroidHandler(); |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 // mojo::ApplicationDelegate: | 31 // mojo::ApplicationDelegate: |
| 30 void Initialize(mojo::ApplicationImpl* app) override; | 32 void Initialize(mojo::ApplicationImpl* app) override; |
| 31 bool ConfigureIncomingConnection( | 33 bool ConfigureIncomingConnection( |
| 32 mojo::ApplicationConnection* connection) override; | 34 mojo::ApplicationConnection* connection) override; |
| 33 | 35 |
| 34 // mojo::ContentHandlerFactory::Delegate: | 36 // mojo::ContentHandlerFactory::Delegate: |
| 35 void RunApplication( | 37 void RunApplication( |
| 36 mojo::InterfaceRequest<mojo::Application> application_request, | 38 mojo::InterfaceRequest<mojo::Application> application_request, |
| 37 mojo::URLResponsePtr response) override; | 39 mojo::URLResponsePtr response) override; |
| 38 | 40 |
| 41 void ExtractApplication(base::FilePath* extracted_dir, |
| 42 base::FilePath* cache_dir, |
| 43 mojo::URLResponsePtr response, |
| 44 const base::Closure& callback); |
| 45 |
| 39 mojo::ContentHandlerFactory content_handler_factory_; | 46 mojo::ContentHandlerFactory content_handler_factory_; |
| 40 IntentReceiverManagerFactory intent_receiver_manager_factory_; | 47 IntentReceiverManagerFactory intent_receiver_manager_factory_; |
| 48 mojo::url_response_disk_cache::URLResponseDiskCachePtr |
| 49 url_response_disk_cache_; |
| 50 scoped_refptr<base::SingleThreadTaskRunner> handler_task_runner_; |
| 41 | 51 |
| 42 MOJO_DISALLOW_COPY_AND_ASSIGN(AndroidHandler); | 52 MOJO_DISALLOW_COPY_AND_ASSIGN(AndroidHandler); |
| 43 }; | 53 }; |
| 44 | 54 |
| 45 bool RegisterAndroidHandlerJni(JNIEnv* env); | 55 bool RegisterAndroidHandlerJni(JNIEnv* env); |
| 46 | 56 |
| 47 } // namespace shell | 57 } // namespace shell |
| 48 | 58 |
| 49 #endif // MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_ | 59 #endif // MOJO_SHELL_ANDROID_CONTENT_HANDLER_H_ |
| OLD | NEW |