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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java

Issue 2772483002: Commment signed webapks working and verified. (Closed)
Patch Set: Added flag and resolved review comments. Created 3 years, 8 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
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 package org.chromium.chrome.browser.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.StrictMode; 8 import android.os.StrictMode;
9 import android.provider.Settings; 9 import android.provider.Settings;
10 10
11 import org.chromium.base.CommandLine;
11 import org.chromium.base.ContextUtils; 12 import org.chromium.base.ContextUtils;
12 import org.chromium.base.Log; 13 import org.chromium.base.Log;
13 import org.chromium.base.annotations.CalledByNative; 14 import org.chromium.base.annotations.CalledByNative;
14 import org.chromium.base.library_loader.LibraryLoader; 15 import org.chromium.base.library_loader.LibraryLoader;
15 import org.chromium.chrome.browser.AppHooks; 16 import org.chromium.chrome.browser.AppHooks;
16 import org.chromium.chrome.browser.ChromeFeatureList; 17 import org.chromium.chrome.browser.ChromeFeatureList;
18 import org.chromium.chrome.browser.ChromeSwitches;
17 import org.chromium.chrome.browser.GooglePlayInstallState; 19 import org.chromium.chrome.browser.GooglePlayInstallState;
18 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; 20 import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
19 import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler; 21 import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
20 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; 22 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
21 import org.chromium.webapk.lib.client.WebApkValidator; 23 import org.chromium.webapk.lib.client.WebApkValidator;
22 24
23 /** 25 /**
24 * Contains functionality needed for Chrome to host WebAPKs. 26 * Contains functionality needed for Chrome to host WebAPKs.
25 */ 27 */
26 public class ChromeWebApkHost { 28 public class ChromeWebApkHost {
27 private static final String TAG = "ChromeWebApkHost"; 29 private static final String TAG = "ChromeWebApkHost";
28 30
29 /** Whether installing WebAPks from Google Play is possible. */ 31 /** Whether installing WebAPks from Google Play is possible. */
30 private static Integer sGooglePlayInstallState; 32 private static Integer sGooglePlayInstallState;
31 33
32 private static Boolean sEnabledForTesting; 34 private static Boolean sEnabledForTesting;
33 35
34 public static void init() { 36 public static void init() {
35 WebApkValidator.initWithBrowserHostSignature(ChromeWebApkHostSignature.E XPECTED_SIGNATURE); 37 WebApkValidator.init(
38 CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_ANY_WE BAPK_PACKAGE_NAME),
Yaron 2017/04/10 14:17:33 Hmm, does this actually work when loaded in chrome
ScottK 2017/04/13 12:04:00 Done.
39 ChromeWebApkHostSignature.EXPECTED_SIGNATURE, ChromeWebApkHostSi gnature.PUBLIC_KEY);
36 } 40 }
37 41
38 public static void initForTesting(boolean enabled) { 42 public static void initForTesting(boolean enabled) {
39 sEnabledForTesting = enabled; 43 sEnabledForTesting = enabled;
40 } 44 }
41 45
42 public static boolean isEnabled() { 46 public static boolean isEnabled() {
43 if (sEnabledForTesting != null) return sEnabledForTesting; 47 if (sEnabledForTesting != null) return sEnabledForTesting;
44 48
45 return isEnabledInPrefs(); 49 return isEnabledInPrefs();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 Settings.Secure.INSTALL_NON_MARKET_APPS) 151 Settings.Secure.INSTALL_NON_MARKET_APPS)
148 == 1; 152 == 1;
149 } catch (Settings.SettingNotFoundException e) { 153 } catch (Settings.SettingNotFoundException e) {
150 return false; 154 return false;
151 } 155 }
152 } 156 }
153 157
154 private static native boolean nativeCanLaunchRendererInWebApkProcess(); 158 private static native boolean nativeCanLaunchRendererInWebApkProcess();
155 private static native boolean nativeCanInstallFromUnknownSources(); 159 private static native boolean nativeCanInstallFromUnknownSources();
156 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698