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

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

Issue 2796773002: [Android WebAPKs] Force navigation on launch by default (Closed)
Patch Set: Merge branch 'master' into fix_deep_link 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
« no previous file with comments | « no previous file | chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java » ('j') | 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 package org.chromium.chrome.browser.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.Intent; 7 import android.content.Intent;
8 import android.content.pm.ApplicationInfo; 8 import android.content.pm.ApplicationInfo;
9 import android.content.pm.PackageManager; 9 import android.content.pm.PackageManager;
10 import android.content.res.Resources; 10 import android.content.res.Resources;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 */ 49 */
50 public static WebApkInfo create(Intent intent) { 50 public static WebApkInfo create(Intent intent) {
51 String webApkPackageName = 51 String webApkPackageName =
52 IntentUtils.safeGetStringExtra(intent, WebApkConstants.EXTRA_WEB APK_PACKAGE_NAME); 52 IntentUtils.safeGetStringExtra(intent, WebApkConstants.EXTRA_WEB APK_PACKAGE_NAME);
53 if (TextUtils.isEmpty(webApkPackageName)) { 53 if (TextUtils.isEmpty(webApkPackageName)) {
54 return null; 54 return null;
55 } 55 }
56 56
57 String url = urlFromIntent(intent); 57 String url = urlFromIntent(intent);
58 int source = sourceFromIntent(intent); 58 int source = sourceFromIntent(intent);
59
60 // Force navigation if the extra is not specified to avoid breaking deep linking for old
61 // WebAPKs which don't specify the {@link WebApkConstants#EXTRA_WEBAPK_F ORCE_NAVIGATION}
62 // intent extra.
59 boolean forceNavigation = IntentUtils.safeGetBooleanExtra( 63 boolean forceNavigation = IntentUtils.safeGetBooleanExtra(
60 intent, WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, false); 64 intent, WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, true);
61 65
62 return create(webApkPackageName, url, source, forceNavigation); 66 return create(webApkPackageName, url, source, forceNavigation);
63 } 67 }
64 68
65 /** 69 /**
66 * Constructs a WebApkInfo from the passed in parameters and <meta-data> in the WebAPK's Android 70 * Constructs a WebApkInfo from the passed in parameters and <meta-data> in the WebAPK's Android
67 * manifest. 71 * manifest.
68 * 72 *
69 * @param webApkPackageName The package name of the WebAPK. 73 * @param webApkPackageName The package name of the WebAPK.
70 * @param url Url that the WebAPK should navigate to when launched. 74 * @param url Url that the WebAPK should navigate to when launched.
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 return ScreenOrientationValues.PORTRAIT; 372 return ScreenOrientationValues.PORTRAIT;
369 } else if (orientation.equals("portrait-primary")) { 373 } else if (orientation.equals("portrait-primary")) {
370 return ScreenOrientationValues.PORTRAIT_PRIMARY; 374 return ScreenOrientationValues.PORTRAIT_PRIMARY;
371 } else if (orientation.equals("portrait-secondary")) { 375 } else if (orientation.equals("portrait-secondary")) {
372 return ScreenOrientationValues.PORTRAIT_SECONDARY; 376 return ScreenOrientationValues.PORTRAIT_SECONDARY;
373 } else { 377 } else {
374 return ScreenOrientationValues.DEFAULT; 378 return ScreenOrientationValues.DEFAULT;
375 } 379 }
376 } 380 }
377 } 381 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698