| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/webapk/chrome_webapk_host.h" | 5 #include "chrome/browser/android/webapk/chrome_webapk_host.h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/chrome_feature_list.h" |
| 8 #include "components/variations/variations_associated_data.h" |
| 7 #include "jni/ChromeWebApkHost_jni.h" | 9 #include "jni/ChromeWebApkHost_jni.h" |
| 8 | 10 |
| 11 namespace { |
| 12 |
| 13 // Variations flag to enable installing WebAPKs using Google Play. |
| 14 const char* kPlayInstall = "play_install"; |
| 15 |
| 16 } // anonymous namespace |
| 17 |
| 18 // static |
| 19 bool ChromeWebApkHost::Register(JNIEnv* env) { |
| 20 return RegisterNativesImpl(env); |
| 21 } |
| 22 |
| 9 // static | 23 // static |
| 10 bool ChromeWebApkHost::AreWebApkEnabled() { | 24 bool ChromeWebApkHost::AreWebApkEnabled() { |
| 11 JNIEnv* env = base::android::AttachCurrentThread(); | 25 JNIEnv* env = base::android::AttachCurrentThread(); |
| 12 return Java_ChromeWebApkHost_areWebApkEnabled(env); | 26 return Java_ChromeWebApkHost_areWebApkEnabled(env); |
| 13 } | 27 } |
| 28 |
| 29 // static |
| 30 jboolean CanUseGooglePlayToInstallWebApk( |
| 31 JNIEnv* env, |
| 32 const base::android::JavaParamRef<jclass>& clazz) { |
| 33 return variations::GetVariationParamValueByFeature( |
| 34 chrome::android::kImprovedA2HS, kPlayInstall) == "true"; |
| 35 } |
| OLD | NEW |