Mac: Fix performance issues with remote CoreAnimation
[chromium-blink-merge.git] / components / variations / android / variations_associated_data_android.cc
blobdb14d8ff0e8a87de90675ea8c78c7b6d159bffec
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 "components/variations/android/variations_associated_data_android.h"
7 #include <string>
9 #include "base/android/jni_string.h"
10 #include "components/variations/variations_associated_data.h"
11 #include "jni/VariationsAssociatedData_jni.h"
13 using base::android::ConvertJavaStringToUTF8;
14 using base::android::ConvertUTF8ToJavaString;
16 namespace variations {
18 namespace android {
20 jstring GetVariationParamValue(JNIEnv* env,
21 jclass clazz,
22 jstring jtrial_name,
23 jstring jparam_name) {
24 std::string trial_name(ConvertJavaStringToUTF8(env, jtrial_name));
25 std::string param_name(ConvertJavaStringToUTF8(env, jparam_name));
26 std::string param_value =
27 variations::GetVariationParamValue(trial_name, param_name);
28 return ConvertUTF8ToJavaString(env, param_value).Release();
31 bool RegisterVariationsAssociatedData(JNIEnv* env) {
32 return RegisterNativesImpl(env);
35 } // namespace android
37 } // namespace variations