| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" | 
| 6 | 6 | 
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" | 
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" | 
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" | 
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" | 
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 666   params.override_user_agent = | 666   params.override_user_agent = | 
| 667       static_cast<NavigationController::UserAgentOverrideOption>( | 667       static_cast<NavigationController::UserAgentOverrideOption>( | 
| 668           ua_override_option); | 668           ua_override_option); | 
| 669 | 669 | 
| 670   if (extra_headers) | 670   if (extra_headers) | 
| 671     params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers); | 671     params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers); | 
| 672 | 672 | 
| 673   if (post_data) { | 673   if (post_data) { | 
| 674     std::vector<uint8> http_body_vector; | 674     std::vector<uint8> http_body_vector; | 
| 675     JavaByteArrayToByteVector(env, post_data, &http_body_vector); | 675     JavaByteArrayToByteVector(env, post_data, &http_body_vector); | 
| 676     params.browser_initiated_post_data = | 676     scoped_refptr<base::RefCountedBytes> data = | 
| 677         base::RefCountedBytes::TakeVector(&http_body_vector); | 677         base::RefCountedBytes::TakeVector(&http_body_vector); | 
|  | 678     std::vector<unsigned char> post_data_char_vector; | 
|  | 679     post_data_char_vector.assign(data->front(), | 
|  | 680                                  data->front() + data->size()); | 
|  | 681     scoped_refptr<webkit_glue::ResourceRequestBody> http_body = | 
|  | 682         new webkit_glue::ResourceRequestBody(); | 
|  | 683     const unsigned char* post_data_char = &post_data_char_vector[0]; | 
|  | 684     http_body->AppendBytes(reinterpret_cast<const char*>(post_data_char), | 
|  | 685                            post_data_char_vector.size()); | 
|  | 686     params.browser_initiated_post_data = http_body; | 
| 678   } | 687   } | 
| 679 | 688 | 
| 680   if (base_url_for_data_url) { | 689   if (base_url_for_data_url) { | 
| 681     params.base_url_for_data_url = | 690     params.base_url_for_data_url = | 
| 682         GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url)); | 691         GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url)); | 
| 683   } | 692   } | 
| 684 | 693 | 
| 685   if (virtual_url_for_data_url) { | 694   if (virtual_url_for_data_url) { | 
| 686     params.virtual_url_for_data_url = | 695     params.virtual_url_for_data_url = | 
| 687         GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); | 696         GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); | 
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1247   if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1256   if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 
| 1248     DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1257     DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 
| 1249     return false; | 1258     return false; | 
| 1250   } | 1259   } | 
| 1251   g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1260   g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 
| 1252 | 1261 | 
| 1253   return RegisterNativesImpl(env) >= 0; | 1262   return RegisterNativesImpl(env) >= 0; | 
| 1254 } | 1263 } | 
| 1255 | 1264 | 
| 1256 }  // namespace content | 1265 }  // namespace content | 
| OLD | NEW | 
|---|