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

Side by Side Diff: chrome/browser/android/webapk/chrome_webapk_host.cc

Issue 2654093006: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/android/webapk/chrome_webapk_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 }
OLDNEW
« 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