|
|
Chromium Code Reviews|
Created:
3 years, 8 months ago by dominickn Modified:
3 years, 8 months ago CC:
chromium-reviews, dominickn+watch_chromium.org, pkotwicz+watch_chromium.org, zpeng+watch_chromium.org, asvitkine+watch_chromium.org, agrieve+watch_chromium.org, chrome-apps-syd-reviews_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdd external intents for WebAPKs to Launch.HomescreenSource.
This CL adds a new EXTERNAL_INTENT source for WebAPK launches that are
created by intenting from other Android apps.
BUG=691739
Review-Url: https://codereview.chromium.org/2790873002
Cr-Commit-Position: refs/heads/master@{#461982}
Committed: https://chromium.googlesource.com/chromium/src/+/a8a006c772c4a44469ae396ff01c2c835a48b670
Patch Set 1 #
Total comments: 2
Patch Set 2 : Address comments #
Total comments: 10
Patch Set 3 : Address comments #Patch Set 4 : Explicit constant #Patch Set 5 : Don't do anything to ExternalNavigationHandler #
Total comments: 2
Patch Set 6 : D'oh #
Messages
Total messages: 45 (28 generated)
The CQ bit was checked by dominickn@chromium.org to run a CQ dry run
dominickn@chromium.org changed reviewers: + pkotwicz@chromium.org
Peter: I *think* this is right. Can you take a look please?
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
https://codereview.chromium.org/2790873002/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); This is only a subset of the times that a WebAPK is launched via a deep link - This if() statement will not be called if there are multiple handlers which can handle the url (For instance, this occurs if you have multiple versions of Chrome installed) - This if() statement does not catch the case of the WebAPK getting launched via GMail (or any other app) A WebAPK is launched from an external intent whenever launchHostBrowserInWebApkMode() is called with a non-null |overrideUrl|
The CQ bit was checked by dominickn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks for the explanation Peter. PTAL! https://codereview.chromium.org/2790873002/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); On 2017/03/31 17:19:28, pkotwicz wrote: > This is only a subset of the times that a WebAPK is launched via a deep link > - This if() statement will not be called if there are multiple handlers which > can handle the url (For instance, this occurs if you have multiple versions of > Chrome installed) > - This if() statement does not catch the case of the WebAPK getting launched via > GMail (or any other app) > > A WebAPK is launched from an external intent whenever > launchHostBrowserInWebApkMode() is called with a non-null |overrideUrl| Cool. I've added another source placement in that method, thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); Isn't this change redundant now? Isn't your change to MainActivity.java sufficient? https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... File chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java:98: : getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0); 1) You only want to set |source| to WebApkConstants.SHORTCUT_SOURCE_EXTERNAL_INTENT if getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0) != 0 in order to handle the WebAPK being launched from a notification. ServiceTabLauncher#launchTab() 2) Whenver you modify code in chrome/android/webapk/shell_apk/ you need to update chrome/android/webapk/shell_apk/shell_apk_version.gni We need to figure out a process for making these changes because the server needs to be updated as well. I suspect that the release process will be: a) Land code changes in chrome/android/webapk/shell_apk/ b) Update server c) Update version number
https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); On 2017/04/04 01:39:19, pkotwicz wrote: > Isn't this change redundant now? Isn't your change to MainActivity.java > sufficient? We know for sure that we're intenting out to the WebAPK here so we may as well explicitly set that. Particularly since I'm a little confused at your advice for the other file: setting this explicitly now gels with what I've done there. https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... File chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java:98: : getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0); On 2017/04/04 01:39:19, pkotwicz wrote: > 1) You only want to set |source| to > WebApkConstants.SHORTCUT_SOURCE_EXTERNAL_INTENT if > > getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0) != 0 > > in order to handle the WebAPK being launched from a notification. > ServiceTabLauncher#launchTab() This doesn't make sense to me. Do you mean override the source if the existing source *is* = 0? If it's coming in from ServiceTabLauncher the source should be set to SOURCE_NOTIFICATION, so overriding when = 0 makes sense. Let me know if I've interpreted this wrong. > 2) Whenver you modify code in chrome/android/webapk/shell_apk/ you need to > update chrome/android/webapk/shell_apk/shell_apk_version.gni We need to figure > out a process for making these changes because the server needs to be updated as > well. I suspect that the release process will be: > a) Land code changes in chrome/android/webapk/shell_apk/ > b) Update server > c) Update version number Thanks! BTW you should add a PRESUBMIT.py file in shell_apk that enforces this.
https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); I still don't think that we should set EXTRA_SOURCE here. It duplicates what we already do in MainActivity.java https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... File chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java:98: : getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0); - Sorry for the confusion. I meant only override when source *is* == 0 - Can you please file a bug to add a PRESUBMIT ?
The CQ bit was checked by dominickn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); On 2017/04/04 03:23:11, pkotwicz wrote: > I still don't think that we should set EXTRA_SOURCE here. It duplicates what we > already do in MainActivity.java This doesn't actually duplicate what happens in MainActivity.java (that code isn't run now if the source is already set). In terms of code health, I think it's better to explicitly set the source here when we know we're setting it to the right value. We may have a new way of launching WebAPKs in the future that we want to categorize separately. And it just feels a bit wrong to have it come out as UNKNOWN from here when we actually know it's from an intent. https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... File chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/webapk/s... chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java:98: : getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0); On 2017/04/04 03:23:11, pkotwicz wrote: > - Sorry for the confusion. I meant only override when source *is* == 0 > > - Can you please file a bug to add a PRESUBMIT ? Filed crbug.com/708053
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); It would be set in MainActivity.java if you don't set the source. The reason that I care is that it is possible for ExternalNavigationHandler to launch a WebAPK without going through this if() statement. In particular, this if() statement is not run if ExternalNavigationHandler shows an intent picker and the user chooses the WebAPK from the intent picker.
The CQ bit was checked by dominickn@chromium.org to run a CQ dry run
dominickn@chromium.org changed reviewers: + isherman@chromium.org
Thanks! +isherman for histograms https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/2790873002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:535: intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.EXTERNAL_INTENT); On 2017/04/04 14:04:10, pkotwicz wrote: > It would be set in MainActivity.java if you don't set the source. > > The reason that I care is that it is possible for ExternalNavigationHandler to > launch a WebAPK without going through this if() statement. In particular, this > if() statement is not run if ExternalNavigationHandler shows an intent picker > and the user chooses the WebAPK from the intent picker. Fair enough, that reasoning seems sound. Removed the change here.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
histograms.xml lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2790873002/diff/80001/chrome/android/webapk/l... File chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java (right): https://codereview.chromium.org/2790873002/diff/80001/chrome/android/webapk/l... chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java:28: public static final int SHORTCUT_SOURCE_UNKNOWN = 9; You mean 0?
https://codereview.chromium.org/2790873002/diff/80001/chrome/android/webapk/l... File chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java (right): https://codereview.chromium.org/2790873002/diff/80001/chrome/android/webapk/l... chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java:28: public static final int SHORTCUT_SOURCE_UNKNOWN = 9; On 2017/04/05 03:01:50, pkotwicz wrote: > You mean 0? D'oh, of course. Good catch.
The CQ bit was checked by dominickn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
LGTM
The CQ bit was checked by dominickn@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from isherman@chromium.org Link to the patchset: https://codereview.chromium.org/2790873002/#ps100001 (title: "D'oh")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
The CQ bit was checked by dominickn@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1491368073461570,
"parent_rev": "3619dab216f9b1e431f5b271fa668eaee0f95112", "commit_rev":
"a8a006c772c4a44469ae396ff01c2c835a48b670"}
Message was sent while issue was closed.
Description was changed from ========== Add external intents for WebAPKs to Launch.HomescreenSource. This CL adds a new EXTERNAL_INTENT source for WebAPK launches that are created by intenting from other Android apps. BUG=691739 ========== to ========== Add external intents for WebAPKs to Launch.HomescreenSource. This CL adds a new EXTERNAL_INTENT source for WebAPK launches that are created by intenting from other Android apps. BUG=691739 Review-Url: https://codereview.chromium.org/2790873002 Cr-Commit-Position: refs/heads/master@{#461982} Committed: https://chromium.googlesource.com/chromium/src/+/a8a006c772c4a44469ae396ff01c... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/a8a006c772c4a44469ae396ff01c... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
