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 #include "shell/android/android_handler.h" | 5 #include "shell/android/android_handler.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 reinterpret_cast<jlong>(run_android_application_fn)); | 124 reinterpret_cast<jlong>(run_android_application_fn)); |
125 } | 125 } |
126 | 126 |
127 void AndroidHandler::Initialize(mojo::ApplicationImpl* app) { | 127 void AndroidHandler::Initialize(mojo::ApplicationImpl* app) { |
128 handler_task_runner_ = base::MessageLoop::current()->task_runner(); | 128 handler_task_runner_ = base::MessageLoop::current()->task_runner(); |
129 mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache", | 129 mojo::ConnectToService(app->shell(), "mojo:url_response_disk_cache", |
130 GetProxy(&url_response_disk_cache_)); | 130 GetProxy(&url_response_disk_cache_)); |
131 } | 131 } |
132 | 132 |
133 bool AndroidHandler::ConfigureIncomingConnection( | 133 bool AndroidHandler::ConfigureIncomingConnection( |
134 mojo::ApplicationConnection* connection) { | 134 mojo::ServiceProviderImpl* service_provider_impl) { |
135 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( | 135 service_provider_impl->AddService<mojo::ContentHandler>( |
136 content_handler_factory_.GetInterfaceRequestHandler()); | 136 content_handler_factory_.GetInterfaceRequestHandler()); |
137 return true; | 137 return true; |
138 } | 138 } |
139 | 139 |
140 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir, | 140 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir, |
141 base::FilePath* cache_dir, | 141 base::FilePath* cache_dir, |
142 mojo::URLResponsePtr response, | 142 mojo::URLResponsePtr response, |
143 const base::Closure& callback) { | 143 const base::Closure& callback) { |
144 url_response_disk_cache_->UpdateAndGetExtracted( | 144 url_response_disk_cache_->UpdateAndGetExtracted( |
145 response.Pass(), | 145 response.Pass(), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release(); | 179 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release(); |
180 } | 180 } |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 bool RegisterAndroidHandlerJni(JNIEnv* env) { | 184 bool RegisterAndroidHandlerJni(JNIEnv* env) { |
185 return RegisterNativesImpl(env); | 185 return RegisterNativesImpl(env); |
186 } | 186 } |
187 | 187 |
188 } // namespace shell | 188 } // namespace shell |
OLD | NEW |