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

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

Issue 2138973002: Initial CL for talking to the WebAPK server to generate WebAPK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2 Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.webapps;
6
7 import android.content.Context;
8
9 import org.chromium.base.ContextUtils;
10 import org.chromium.base.annotations.CalledByNative;
11 import org.chromium.chrome.browser.ChromeApplication;
12
13 /**
14 * Java counterpart to webapk_installer.h
15 * Contains functionality to install WebAPKs.
16 */
17 public class WebApkInstallerBridge {
18 // Prevent instantiation.
19 private WebApkInstallerBridge() {}
20
21 /**
22 * Installs a WebAPK.
23 * @param filePath File to install.
24 * @param packageName Package name to install WebAPK at.
25 * @return True if the install was started. A "true" return value does not g uarantee that the
26 * install succeeds.
27 */
28 @CalledByNative
29 static boolean installAsync(String filePath, String packageName) {
30 Context context = ContextUtils.getApplicationContext();
31 WebApkInstaller apkInstaller = ((ChromeApplication) context).createWebAp kInstaller();
32 if (apkInstaller == null) {
33 return false;
34 }
35 apkInstaller.installAsync(filePath, packageName);
36 return true;
37 }
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698