diff options
author | maxbogue@chromium.org <maxbogue@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-21 13:23:26 +0000 |
---|---|---|
committer | maxbogue@chromium.org <maxbogue@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-21 13:23:26 +0000 |
commit | 31fd046884ae4bec8946a3a5e2007411763beb09 (patch) | |
tree | 593cf7df29bf7acd449b69de8d36a87c2fcd7864 /base/android/field_trial_list.cc | |
parent | a931dc2a984761efbd2b8d9fc6a768d246e0df4a (diff) | |
download | chromium_src-31fd046884ae4bec8946a3a5e2007411763beb09.zip chromium_src-31fd046884ae4bec8946a3a5e2007411763beb09.tar.gz chromium_src-31fd046884ae4bec8946a3a5e2007411763beb09.tar.bz2 |
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
Diffstat (limited to 'base/android/field_trial_list.cc')
-rw-r--r-- | base/android/field_trial_list.cc | 33 |
1 files changed, 33 insertions, 0 deletions
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 <jni.h> + +#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 |