Cleanup setting of 'sysroot' in common.gypi
[chromium-blink-merge.git] / base / android / field_trial_list.cc
blob9731a48e550e7148172c1b64a6044d0901328fb6
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.
5 #include "base/android/field_trial_list.h"
7 #include <jni.h>
9 #include "base/android/jni_string.h"
10 #include "base/metrics/field_trial.h"
11 #include "jni/FieldTrialList_jni.h"
13 using base::android::ConvertJavaStringToUTF8;
14 using base::android::ConvertUTF8ToJavaString;
16 static ScopedJavaLocalRef<jstring> FindFullName(
17 JNIEnv* env,
18 const JavaParamRef<jclass>& clazz,
19 const JavaParamRef<jstring>& jtrial_name) {
20 std::string trial_name(ConvertJavaStringToUTF8(env, jtrial_name));
21 return ConvertUTF8ToJavaString(
22 env, base::FieldTrialList::FindFullName(trial_name));
25 static jboolean TrialExists(JNIEnv* env,
26 const JavaParamRef<jclass>& clazz,
27 const JavaParamRef<jstring>& jtrial_name) {
28 std::string trial_name(ConvertJavaStringToUTF8(env, jtrial_name));
29 return base::FieldTrialList::TrialExists(trial_name);
32 namespace base {
33 namespace android {
35 bool RegisterFieldTrialList(JNIEnv* env) {
36 return RegisterNativesImpl(env);
39 } // namespace android
40 } // namespace base