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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::ApplicationConnection* connection) { |
135 connection->AddService(&content_handler_factory_); | 135 connection->GetServiceProviderImpl().AddService<mojo::ContentHandler>( |
| 136 content_handler_factory_.GetInterfaceRequestHandler()); |
136 return true; | 137 return true; |
137 } | 138 } |
138 | 139 |
139 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir, | 140 void AndroidHandler::ExtractApplication(base::FilePath* extracted_dir, |
140 base::FilePath* cache_dir, | 141 base::FilePath* cache_dir, |
141 mojo::URLResponsePtr response, | 142 mojo::URLResponsePtr response, |
142 const base::Closure& callback) { | 143 const base::Closure& callback) { |
143 url_response_disk_cache_->UpdateAndGetExtracted( | 144 url_response_disk_cache_->UpdateAndGetExtracted( |
144 response.Pass(), | 145 response.Pass(), |
145 [extracted_dir, cache_dir, callback](mojo::Array<uint8_t> extracted_path, | 146 [extracted_dir, cache_dir, callback](mojo::Array<uint8_t> extracted_path, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release(); | 179 return ConvertUTF8ToJavaString(env, temporary_file.value()).Release(); |
179 } | 180 } |
180 } | 181 } |
181 } | 182 } |
182 | 183 |
183 bool RegisterAndroidHandlerJni(JNIEnv* env) { | 184 bool RegisterAndroidHandlerJni(JNIEnv* env) { |
184 return RegisterNativesImpl(env); | 185 return RegisterNativesImpl(env); |
185 } | 186 } |
186 | 187 |
187 } // namespace shell | 188 } // namespace shell |
OLD | NEW |