blob: 769450fa9d2816558f67aa50c4dfc6e7dee03ff8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/navigation_interception/navigation_params_android.h"
#include "base/android/jni_string.h"
#include "jni/NavigationParams_jni.h"
using base::android::ConvertUTF8ToJavaString;
namespace navigation_interception {
base::android::ScopedJavaLocalRef<jobject> CreateJavaNavigationParams(
JNIEnv* env,
const NavigationParams& params) {
ScopedJavaLocalRef<jstring> jstring_url =
ConvertUTF8ToJavaString(env, params.url().spec());
return Java_NavigationParams_create(env,
jstring_url.obj(),
params.is_post(),
params.has_user_gesture(),
params.transition_type(),
params.is_redirect());
}
// Register native methods.
bool RegisterNavigationParams(JNIEnv* env) {
return RegisterNativesImpl(env);
}
} // namespace navigation_interception
|