| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
| 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" | 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
| 10 #include "android_webview/browser/in_process_view_renderer.h" | 10 #include "android_webview/browser/in_process_view_renderer.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 void AwContents::GenerateMHTML(JNIEnv* env, jobject obj, | 316 void AwContents::GenerateMHTML(JNIEnv* env, jobject obj, |
| 317 jstring jpath, jobject callback) { | 317 jstring jpath, jobject callback) { |
| 318 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); | 318 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); |
| 319 j_callback->Reset(env, callback); | 319 j_callback->Reset(env, callback); |
| 320 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); | 320 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); |
| 321 web_contents_->GenerateMHTML( | 321 web_contents_->GenerateMHTML( |
| 322 target_path, | 322 target_path, |
| 323 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); | 323 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void AwContents::PerformLongClick() { | |
| 327 JNIEnv* env = AttachCurrentThread(); | |
| 328 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
| 329 if (obj.is_null()) | |
| 330 return; | |
| 331 | |
| 332 Java_AwContents_performLongClick(env, obj.obj()); | |
| 333 } | |
| 334 | |
| 335 bool AwContents::OnReceivedHttpAuthRequest(const JavaRef<jobject>& handler, | 326 bool AwContents::OnReceivedHttpAuthRequest(const JavaRef<jobject>& handler, |
| 336 const std::string& host, | 327 const std::string& host, |
| 337 const std::string& realm) { | 328 const std::string& realm) { |
| 338 JNIEnv* env = AttachCurrentThread(); | 329 JNIEnv* env = AttachCurrentThread(); |
| 339 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 330 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 340 if (obj.is_null()) | 331 if (obj.is_null()) |
| 341 return false; | 332 return false; |
| 342 | 333 |
| 343 ScopedJavaLocalRef<jstring> jhost = ConvertUTF8ToJavaString(env, host); | 334 ScopedJavaLocalRef<jstring> jhost = ConvertUTF8ToJavaString(env, host); |
| 344 ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm); | 335 ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 browser_view_renderer_->EnableOnNewPicture(enabled); | 787 browser_view_renderer_->EnableOnNewPicture(enabled); |
| 797 } | 788 } |
| 798 | 789 |
| 799 void AwContents::SetJsOnlineProperty(JNIEnv* env, | 790 void AwContents::SetJsOnlineProperty(JNIEnv* env, |
| 800 jobject obj, | 791 jobject obj, |
| 801 jboolean network_up) { | 792 jboolean network_up) { |
| 802 render_view_host_ext_->SetJsOnlineProperty(network_up); | 793 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 803 } | 794 } |
| 804 | 795 |
| 805 } // namespace android_webview | 796 } // namespace android_webview |
| OLD | NEW |