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

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

Issue 2758193002: [Android WebAPKs] Don't navigate WebAPK when launching it from launcher (Closed)
Patch Set: Merge branch 'package_name2' into twitter Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.ActivityManager; 7 import android.app.ActivityManager;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.pm.ApplicationInfo; 10 import android.content.pm.ApplicationInfo;
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 List<Integer> orientations = new ArrayList<>(); 682 List<Integer> orientations = new ArrayList<>();
683 List<Long> themeColors = new ArrayList<>(); 683 List<Long> themeColors = new ArrayList<>();
684 List<Long> backgroundColors = new ArrayList<>(); 684 List<Long> backgroundColors = new ArrayList<>();
685 685
686 Context context = ContextUtils.getApplicationContext(); 686 Context context = ContextUtils.getApplicationContext();
687 PackageManager packageManager = context.getPackageManager(); 687 PackageManager packageManager = context.getPackageManager();
688 for (PackageInfo packageInfo : packageManager.getInstalledPackages(0)) { 688 for (PackageInfo packageInfo : packageManager.getInstalledPackages(0)) {
689 if (WebApkValidator.isValidWebApk(context, packageInfo.packageName)) { 689 if (WebApkValidator.isValidWebApk(context, packageInfo.packageName)) {
690 // Pass non-null URL parameter so that {@link WebApkInfo#create( )} 690 // Pass non-null URL parameter so that {@link WebApkInfo#create( )}
691 // return value is non-null 691 // return value is non-null
692 WebApkInfo webApkInfo = 692 WebApkInfo webApkInfo = WebApkInfo.create(
693 WebApkInfo.create(packageInfo.packageName, "", ShortcutS ource.UNKNOWN); 693 packageInfo.packageName, "", false, ShortcutSource.UNKNO WN);
dominickn 2017/03/21 02:09:32 Nit: add /* forceNavigation */ after the boolean p
694 if (webApkInfo != null) { 694 if (webApkInfo != null) {
695 names.add(webApkInfo.name()); 695 names.add(webApkInfo.name());
696 shortNames.add(webApkInfo.shortName()); 696 shortNames.add(webApkInfo.shortName());
697 packageNames.add(webApkInfo.webApkPackageName()); 697 packageNames.add(webApkInfo.webApkPackageName());
698 shellApkVersions.add(webApkInfo.shellApkVersion()); 698 shellApkVersions.add(webApkInfo.shellApkVersion());
699 versionCodes.add(packageInfo.versionCode); 699 versionCodes.add(packageInfo.versionCode);
700 uris.add(webApkInfo.uri().toString()); 700 uris.add(webApkInfo.uri().toString());
701 scopes.add(webApkInfo.scopeUri().toString()); 701 scopes.add(webApkInfo.scopeUri().toString());
702 manifestUrls.add(webApkInfo.manifestUrl()); 702 manifestUrls.add(webApkInfo.manifestUrl());
703 manifestStartUrls.add(webApkInfo.manifestStartUrl()); 703 manifestStartUrls.add(webApkInfo.manifestStartUrl());
(...skipping 28 matching lines...) Expand all
732 } 732 }
733 return array; 733 return array;
734 } 734 }
735 735
736 private static native void nativeOnWebappDataStored(long callbackPointer); 736 private static native void nativeOnWebappDataStored(long callbackPointer);
737 private static native void nativeOnWebApksRetrieved(long callbackPointer, St ring[] names, 737 private static native void nativeOnWebApksRetrieved(long callbackPointer, St ring[] names,
738 String[] shortNames, String[] packageName, int[] shellApkVersions, i nt[] versionCodes, 738 String[] shortNames, String[] packageName, int[] shellApkVersions, i nt[] versionCodes,
739 String[] uris, String[] scopes, String[] manifestUrls, String[] mani festStartUrls, 739 String[] uris, String[] scopes, String[] manifestUrls, String[] mani festStartUrls,
740 int[] displayModes, int[] orientations, long[] themeColors, long[] b ackgroundColors); 740 int[] displayModes, int[] orientations, long[] themeColors, long[] b ackgroundColors);
741 } 741 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698