Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / base / android / jni_generator / sample_for_tests.h
blobc98cf97693638963a322c3fd582bb7f541f526b1
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
3 // found in the LICENSE file.
5 #ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_
6 #define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_
8 #include <jni.h>
9 #include <map>
10 #include <string>
12 #include "base/android/jni_android.h"
13 #include "base/basictypes.h"
15 namespace base {
16 namespace android {
18 // This file is used to:
19 // - document the best practices and guidelines on JNI usage.
20 // - ensure sample_for_tests_jni.h compiles and the functions declared in it
21 // as expected.
23 // All methods are called directly from Java. See more documentation in
24 // SampleForTests.java.
25 class CPPClass {
26 public:
27 CPPClass();
28 ~CPPClass();
30 class InnerClass {
31 public:
32 jdouble MethodOtherP0(JNIEnv* env, jobject obj);
35 void Destroy(JNIEnv* env, jobject obj);
37 jint Method(JNIEnv* env, jobject obj);
39 void AddStructB(JNIEnv* env, jobject obj, jobject structb);
41 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject obj);
43 base::android::ScopedJavaLocalRef<jstring> ReturnAString(
44 JNIEnv* env, jobject obj);
46 private:
47 std::map<long, std::string> map_;
49 DISALLOW_COPY_AND_ASSIGN(CPPClass);
52 } // namespace android
53 } // namespace base
55 #endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_