Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: chrome/browser/android/webapk/chrome_webapk_host.cc

Issue 2655803002: WebAPKs: Fix play-install variations check (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/webapk/chrome_webapk_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapk/chrome_webapk_host.cc
diff --git a/chrome/browser/android/webapk/chrome_webapk_host.cc b/chrome/browser/android/webapk/chrome_webapk_host.cc
index 4014e2f6fbd9811ae0bb45a627de8bbbf79b57e7..1ebfe489246fc3076d391f0c714144da27011ca7 100644
--- a/chrome/browser/android/webapk/chrome_webapk_host.cc
+++ b/chrome/browser/android/webapk/chrome_webapk_host.cc
@@ -4,10 +4,32 @@
#include "chrome/browser/android/webapk/chrome_webapk_host.h"
+#include "chrome/browser/android/chrome_feature_list.h"
+#include "components/variations/variations_associated_data.h"
#include "jni/ChromeWebApkHost_jni.h"
+namespace {
+
+// Variations flag to enable installing WebAPKs using Google Play.
+const char* kPlayInstall = "play_install";
+
+} // anonymous namespace
+
+// static
+bool ChromeWebApkHost::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
// static
bool ChromeWebApkHost::AreWebApkEnabled() {
JNIEnv* env = base::android::AttachCurrentThread();
return Java_ChromeWebApkHost_areWebApkEnabled(env);
}
+
+// static
+jboolean CanUseGooglePlayToInstallWebApk(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jclass>& clazz) {
+ return variations::GetVariationParamValueByFeature(
+ chrome::android::kImprovedA2HS, kPlayInstall) == "true";
+}
« no previous file with comments | « chrome/browser/android/webapk/chrome_webapk_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698