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