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 654 matching lines...) Loading... | |
665 params.override_user_agent = | 665 params.override_user_agent = |
666 static_cast<NavigationController::UserAgentOverrideOption>( | 666 static_cast<NavigationController::UserAgentOverrideOption>( |
667 ua_override_option); | 667 ua_override_option); |
668 | 668 |
669 if (extra_headers) | 669 if (extra_headers) |
670 params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers); | 670 params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers); |
671 | 671 |
672 if (post_data) { | 672 if (post_data) { |
673 std::vector<uint8> http_body_vector; | 673 std::vector<uint8> http_body_vector; |
674 JavaByteArrayToByteVector(env, post_data, &http_body_vector); | 674 JavaByteArrayToByteVector(env, post_data, &http_body_vector); |
675 params.browser_initiated_post_data = | 675 scoped_refptr<base::RefCountedBytes> data = |
676 base::RefCountedBytes::TakeVector(&http_body_vector); | 676 base::RefCountedBytes::TakeVector(&post_data_vector); |
Charlie Reis
2012/11/20 05:46:03
nit: Indent 2 more spaces.
irobert
2012/11/22 01:37:00
Done.
| |
677 std::vector<unsigned char> post_data_char; | |
678 post_data_char.assign(data->front(), | |
679 data->front() + data->size()); | |
680 scoped_refptr<webkit_glue::ResourceRequestBody> http_body = | |
681 new webkit_glue::ResourceRequestBody(); | |
682 http_body->AppendBytes(reinterpret_cast<const char*>(post_data_char), | |
683 post_data_char.size()); | |
684 params.browser_initiated_post_data = http_body; | |
677 } | 685 } |
678 | 686 |
679 if (base_url_for_data_url) { | 687 if (base_url_for_data_url) { |
680 params.base_url_for_data_url = | 688 params.base_url_for_data_url = |
681 GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url)); | 689 GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url)); |
682 } | 690 } |
683 | 691 |
684 if (virtual_url_for_data_url) { | 692 if (virtual_url_for_data_url) { |
685 params.virtual_url_for_data_url = | 693 params.virtual_url_for_data_url = |
686 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); | 694 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); |
(...skipping 543 matching lines...) Loading... | |
1230 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1238 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
1231 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1239 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
1232 return false; | 1240 return false; |
1233 } | 1241 } |
1234 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1242 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
1235 | 1243 |
1236 return RegisterNativesImpl(env) >= 0; | 1244 return RegisterNativesImpl(env) >= 0; |
1237 } | 1245 } |
1238 | 1246 |
1239 } // namespace content | 1247 } // namespace content |
OLD | NEW |