OLD | NEW |
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 Loading... |
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(packageInfo.packageNam
e, "", |
693 WebApkInfo.create(packageInfo.packageName, "", ShortcutS
ource.UNKNOWN); | 693 ShortcutSource.UNKNOWN, false /* forceNavigation */); |
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 Loading... |
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 } |
OLD | NEW |