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

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

Issue 2056383002: Upstream: Initialize ChromeWebApkHost in WebappLaunchActivity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 4 years, 6 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/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.app.Activity; 7 import android.app.Activity;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.net.Uri; 9 import android.net.Uri;
10 import android.os.Build; 10 import android.os.Build;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 String webApkPackageName = webappInfo.webApkPackageName(); 57 String webApkPackageName = webappInfo.webApkPackageName();
58 int webappSource = webappInfo.source(); 58 int webappSource = webappInfo.source();
59 59
60 if (webappId != null && webappUrl != null) { 60 if (webappId != null && webappUrl != null) {
61 Intent launchIntent = null; 61 Intent launchIntent = null;
62 62
63 // Permit the launch to a standalone web app frame if any of the fol lowing are true: 63 // Permit the launch to a standalone web app frame if any of the fol lowing are true:
64 // - the request was for a WebAPK that is valid; 64 // - the request was for a WebAPK that is valid;
65 // - the MAC is present and valid for the homescreen shortcut to be opened; 65 // - the MAC is present and valid for the homescreen shortcut to be opened;
66 // - the intent was sent by Chrome. 66 // - the intent was sent by Chrome.
67 if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_WEBAPK )) {
68 ChromeWebApkHost.init();
69 }
67 boolean isValidWebApk = isValidWebApk(webApkPackageName, webappUrl); 70 boolean isValidWebApk = isValidWebApk(webApkPackageName, webappUrl);
68 71
69 if (isValidWebApk 72 if (isValidWebApk
70 || isValidMacForUrl(webappUrl, IntentUtils.safeGetStringExtr a( 73 || isValidMacForUrl(webappUrl, IntentUtils.safeGetStringExtr a(
71 intent, ShortcutHelper.EXTRA_MAC)) 74 intent, ShortcutHelper.EXTRA_MAC))
72 || wasIntentFromChrome(intent)) { 75 || wasIntentFromChrome(intent)) {
73 LaunchMetrics.recordHomeScreenLaunchIntoStandaloneActivity(webap pUrl, webappSource); 76 LaunchMetrics.recordHomeScreenLaunchIntoStandaloneActivity(webap pUrl, webappSource);
74 launchIntent = createWebappLaunchIntent(webappInfo, isValidWebAp k); 77 launchIntent = createWebappLaunchIntent(webappInfo, isValidWebAp k);
75 } else { 78 } else {
76 Log.e(TAG, "Shortcut (%s) opened in Chrome.", webappUrl); 79 Log.e(TAG, "Shortcut (%s) opened in Chrome.", webappUrl);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 Log.d(TAG, "%s is not valid WebAPK", webApkPackage); 188 Log.d(TAG, "%s is not valid WebAPK", webApkPackage);
186 return false; 189 return false;
187 } 190 }
188 if (!webApkPackage.equals(WebApkValidator.queryWebApkPackage(this, url)) ) { 191 if (!webApkPackage.equals(WebApkValidator.queryWebApkPackage(this, url)) ) {
189 Log.d(TAG, "%s is not within scope of %s WebAPK", url, webApkPackage ); 192 Log.d(TAG, "%s is not within scope of %s WebAPK", url, webApkPackage );
190 return false; 193 return false;
191 } 194 }
192 return true; 195 return true;
193 } 196 }
194 } 197 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698