1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5
6// This file is autogenerated by
7//     base/android/jni_generator/jni_generator.py
8// For
9//     org/chromium/TestJni
10
11#ifndef org_chromium_TestJni_JNI
12#define org_chromium_TestJni_JNI
13
14#include <jni.h>
15
16#include "base/android/jni_generator/jni_generator_helper.h"
17
18
19// Step 1: Forward declarations.
20
21JNI_REGISTRATION_EXPORT extern const char kClassPath_org_chromium_TestJni[];
22const char kClassPath_org_chromium_TestJni[] = "org/chromium/TestJni";
23// Leaking this jclass as we cannot use LazyInstance from some threads.
24JNI_REGISTRATION_EXPORT base::subtle::AtomicWord g_org_chromium_TestJni_clazz = 0;
25#ifndef org_chromium_TestJni_clazz_defined
26#define org_chromium_TestJni_clazz_defined
27inline jclass org_chromium_TestJni_clazz(JNIEnv* env) {
28  return base::android::LazyGetClass(env, kClassPath_org_chromium_TestJni,
29      &g_org_chromium_TestJni_clazz);
30}
31#endif
32
33
34// Step 2: Constants (optional).
35
36
37// Step 3: Method stubs.
38static jint JNI_TestJni_Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& jcaller);
39
40JNI_GENERATOR_EXPORT jint Java_org_chromium_TestJni_nativeInit(
41    JNIEnv* env,
42    jobject jcaller) {
43  return JNI_TestJni_Init(env, base::android::JavaParamRef<jobject>(env, jcaller));
44}
45
46JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeDestroy(
47    JNIEnv* env,
48    jobject jcaller,
49    jint nativeChromeBrowserProvider) {
50  ChromeBrowserProvider* native =
51      reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
52  CHECK_NATIVE_PTR(env, jcaller, native, "Destroy");
53  return native->Destroy(env, base::android::JavaParamRef<jobject>(env, jcaller));
54}
55
56JNI_GENERATOR_EXPORT jlong Java_org_chromium_TestJni_nativeAddBookmark(
57    JNIEnv* env,
58    jobject jcaller,
59    jint nativeChromeBrowserProvider,
60    jstring url,
61    jstring title,
62    jboolean isFolder,
63    jlong parentId) {
64  ChromeBrowserProvider* native =
65      reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
66  CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmark", 0);
67  return native->AddBookmark(env, base::android::JavaParamRef<jobject>(env, jcaller),
68      base::android::JavaParamRef<jstring>(env, url), base::android::JavaParamRef<jstring>(env,
69      title), isFolder, parentId);
70}
71
72static base::android::ScopedJavaLocalRef<jstring> JNI_TestJni_GetDomainAndRegistry(JNIEnv* env,
73    const base::android::JavaParamRef<jclass>& jcaller,
74    const base::android::JavaParamRef<jstring>& url);
75
76JNI_GENERATOR_EXPORT jstring Java_org_chromium_TestJni_nativeGetDomainAndRegistry(
77    JNIEnv* env,
78    jclass jcaller,
79    jstring url) {
80  return JNI_TestJni_GetDomainAndRegistry(env, base::android::JavaParamRef<jclass>(env, jcaller),
81      base::android::JavaParamRef<jstring>(env, url)).Release();
82}
83
84static void JNI_TestJni_CreateHistoricalTabFromState(JNIEnv* env, const
85    base::android::JavaParamRef<jclass>& jcaller,
86    const base::android::JavaParamRef<jbyteArray>& state,
87    jint tab_index);
88
89JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeCreateHistoricalTabFromState(
90    JNIEnv* env,
91    jclass jcaller,
92    jbyteArray state,
93    jint tab_index) {
94  return JNI_TestJni_CreateHistoricalTabFromState(env, base::android::JavaParamRef<jclass>(env,
95      jcaller), base::android::JavaParamRef<jbyteArray>(env, state), tab_index);
96}
97
98static base::android::ScopedJavaLocalRef<jbyteArray> JNI_TestJni_GetStateAsByteArray(JNIEnv* env,
99    const base::android::JavaParamRef<jobject>& jcaller,
100    const base::android::JavaParamRef<jobject>& view);
101
102JNI_GENERATOR_EXPORT jbyteArray Java_org_chromium_TestJni_nativeGetStateAsByteArray(
103    JNIEnv* env,
104    jobject jcaller,
105    jobject view) {
106  return JNI_TestJni_GetStateAsByteArray(env, base::android::JavaParamRef<jobject>(env, jcaller),
107      base::android::JavaParamRef<jobject>(env, view)).Release();
108}
109
110static base::android::ScopedJavaLocalRef<jobjectArray> JNI_TestJni_GetAutofillProfileGUIDs(JNIEnv*
111    env, const base::android::JavaParamRef<jclass>& jcaller);
112
113JNI_GENERATOR_EXPORT jobjectArray Java_org_chromium_TestJni_nativeGetAutofillProfileGUIDs(
114    JNIEnv* env,
115    jclass jcaller) {
116  return JNI_TestJni_GetAutofillProfileGUIDs(env, base::android::JavaParamRef<jclass>(env,
117      jcaller)).Release();
118}
119
120static void JNI_TestJni_SetRecognitionResults(JNIEnv* env, const
121    base::android::JavaParamRef<jobject>& jcaller,
122    jint sessionId,
123    const base::android::JavaParamRef<jobjectArray>& results);
124
125JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeSetRecognitionResults(
126    JNIEnv* env,
127    jobject jcaller,
128    jint sessionId,
129    jobjectArray results) {
130  return JNI_TestJni_SetRecognitionResults(env, base::android::JavaParamRef<jobject>(env, jcaller),
131      sessionId, base::android::JavaParamRef<jobjectArray>(env, results));
132}
133
134JNI_GENERATOR_EXPORT jlong Java_org_chromium_TestJni_nativeAddBookmarkFromAPI(
135    JNIEnv* env,
136    jobject jcaller,
137    jint nativeChromeBrowserProvider,
138    jstring url,
139    jobject created,
140    jobject isBookmark,
141    jobject date,
142    jbyteArray favicon,
143    jstring title,
144    jobject visits) {
145  ChromeBrowserProvider* native =
146      reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
147  CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmarkFromAPI", 0);
148  return native->AddBookmarkFromAPI(env, base::android::JavaParamRef<jobject>(env, jcaller),
149      base::android::JavaParamRef<jstring>(env, url), base::android::JavaParamRef<jobject>(env,
150      created), base::android::JavaParamRef<jobject>(env, isBookmark),
151      base::android::JavaParamRef<jobject>(env, date), base::android::JavaParamRef<jbyteArray>(env,
152      favicon), base::android::JavaParamRef<jstring>(env, title),
153      base::android::JavaParamRef<jobject>(env, visits));
154}
155
156static jint JNI_TestJni_FindAll(JNIEnv* env, const base::android::JavaParamRef<jobject>& jcaller,
157    const base::android::JavaParamRef<jstring>& find);
158
159JNI_GENERATOR_EXPORT jint Java_org_chromium_TestJni_nativeFindAll(
160    JNIEnv* env,
161    jobject jcaller,
162    jstring find) {
163  return JNI_TestJni_FindAll(env, base::android::JavaParamRef<jobject>(env, jcaller),
164      base::android::JavaParamRef<jstring>(env, find));
165}
166
167static base::android::ScopedJavaLocalRef<jobject> JNI_TestJni_GetInnerClass(JNIEnv* env, const
168    base::android::JavaParamRef<jclass>& jcaller);
169
170JNI_GENERATOR_EXPORT jobject Java_org_chromium_TestJni_nativeGetInnerClass(
171    JNIEnv* env,
172    jclass jcaller) {
173  return JNI_TestJni_GetInnerClass(env, base::android::JavaParamRef<jclass>(env,
174      jcaller)).Release();
175}
176
177JNI_GENERATOR_EXPORT jobject Java_org_chromium_TestJni_nativeQueryBitmap(
178    JNIEnv* env,
179    jobject jcaller,
180    jint nativeChromeBrowserProvider,
181    jobjectArray projection,
182    jstring selection,
183    jobjectArray selectionArgs,
184    jstring sortOrder) {
185  ChromeBrowserProvider* native =
186      reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
187  CHECK_NATIVE_PTR(env, jcaller, native, "QueryBitmap", NULL);
188  return native->QueryBitmap(env, base::android::JavaParamRef<jobject>(env, jcaller),
189      base::android::JavaParamRef<jobjectArray>(env, projection),
190      base::android::JavaParamRef<jstring>(env, selection),
191      base::android::JavaParamRef<jobjectArray>(env, selectionArgs),
192      base::android::JavaParamRef<jstring>(env, sortOrder)).Release();
193}
194
195JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeGotOrientation(
196    JNIEnv* env,
197    jobject jcaller,
198    jint nativeDataFetcherImplAndroid,
199    jdouble alpha,
200    jdouble beta,
201    jdouble gamma) {
202  DataFetcherImplAndroid* native =
203      reinterpret_cast<DataFetcherImplAndroid*>(nativeDataFetcherImplAndroid);
204  CHECK_NATIVE_PTR(env, jcaller, native, "GotOrientation");
205  return native->GotOrientation(env, base::android::JavaParamRef<jobject>(env, jcaller), alpha,
206      beta, gamma);
207}
208
209static base::android::ScopedJavaLocalRef<jthrowable> JNI_TestJni_MessWithJavaException(JNIEnv* env,
210    const base::android::JavaParamRef<jclass>& jcaller,
211    const base::android::JavaParamRef<jthrowable>& e);
212
213JNI_GENERATOR_EXPORT jthrowable Java_org_chromium_TestJni_nativeMessWithJavaException(
214    JNIEnv* env,
215    jclass jcaller,
216    jthrowable e) {
217  return JNI_TestJni_MessWithJavaException(env, base::android::JavaParamRef<jclass>(env, jcaller),
218      base::android::JavaParamRef<jthrowable>(env, e)).Release();
219}
220
221
222#endif  // org_chromium_TestJni_JNI
223