Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: components/navigation_interception/navigation_params_android.cc

Issue 615853006: Escape url to be used in Java layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "components/navigation_interception/navigation_params_android.h" 5 #include "components/navigation_interception/navigation_params_android.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "jni/NavigationParams_jni.h" 8 #include "jni/NavigationParams_jni.h"
9 #include "net/base/escape.h"
9 10
10 using base::android::ConvertUTF8ToJavaString; 11 using base::android::ConvertUTF8ToJavaString;
11 12
12 namespace navigation_interception { 13 namespace navigation_interception {
13 14
14 base::android::ScopedJavaLocalRef<jobject> CreateJavaNavigationParams( 15 base::android::ScopedJavaLocalRef<jobject> CreateJavaNavigationParams(
15 JNIEnv* env, 16 JNIEnv* env,
16 const NavigationParams& params) { 17 const NavigationParams& params) {
17 ScopedJavaLocalRef<jstring> jstring_url = 18 ScopedJavaLocalRef<jstring> jstring_url = ConvertUTF8ToJavaString(
18 ConvertUTF8ToJavaString(env, params.url().spec()); 19 env, net::EscapeExternalHandlerValue(params.url().spec()));
Jaekyun Seok (inactive) 2014/10/02 15:31:19 This doesn't seem a proper method for web url esca
Jaekyun Seok (inactive) 2014/10/02 16:30:18 I added my own logic to escape only queries.
19 20
20 return Java_NavigationParams_create(env, 21 return Java_NavigationParams_create(env,
21 jstring_url.obj(), 22 jstring_url.obj(),
22 params.is_post(), 23 params.is_post(),
23 params.has_user_gesture(), 24 params.has_user_gesture(),
24 params.transition_type(), 25 params.transition_type(),
25 params.is_redirect()); 26 params.is_redirect());
26 } 27 }
27 28
28 // Register native methods. 29 // Register native methods.
29 30
30 bool RegisterNavigationParams(JNIEnv* env) { 31 bool RegisterNavigationParams(JNIEnv* env) {
31 return RegisterNativesImpl(env); 32 return RegisterNativesImpl(env);
32 } 33 }
33 34
34 } // namespace navigation_interception 35 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698