From 31fd046884ae4bec8946a3a5e2007411763beb09 Mon Sep 17 00:00:00 2001 From: "maxbogue@chromium.org" Date: Sat, 21 Jun 2014 13:23:26 +0000 Subject: Move FieldTrialHelper from chrome to base and call it FieldTrialList. BUG=385213 Review URL: https://codereview.chromium.org/334953004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278957 0039d316-1c4b-4281-b951-d872f2087c98 --- base/android/field_trial_list.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 base/android/field_trial_list.cc (limited to 'base/android/field_trial_list.cc') diff --git a/base/android/field_trial_list.cc b/base/android/field_trial_list.cc new file mode 100644 index 0000000..13f3cc5 --- /dev/null +++ b/base/android/field_trial_list.cc @@ -0,0 +1,33 @@ +// Copyright 2014 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 "base/android/field_trial_list.h" + +#include + +#include "base/android/jni_string.h" +#include "base/metrics/field_trial.h" +#include "jni/FieldTrialList_jni.h" + +using base::android::ConvertJavaStringToUTF8; +using base::android::ConvertUTF8ToJavaString; + +static jstring FindFullName(JNIEnv* env, + jclass clazz, + jstring jtrial_name) { + std::string trial_name(ConvertJavaStringToUTF8(env, jtrial_name)); + return ConvertUTF8ToJavaString( + env, + base::FieldTrialList::FindFullName(trial_name)).Release(); +} + +namespace base { +namespace android { + +bool RegisterFieldTrialList(JNIEnv* env) { + return RegisterNativesImpl(env); +} + +} // namespace android +} // namespace base -- cgit v1.1