This CL fixes the flakiness in WebAppIntegration browser tests that are
related to the AppBanagerManager by terminating any pending app banner
prompts. This also includes a sample browser test that tests the
termination of pending banners.
Bug: 1324788
Change-Id: I27d8c9bbc2a6f2520c837bf0679f34eb26dd5020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3680399
Commit-Queue: Dibyajyoti Pal <dibyapal@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011788}
This is a reland of commit 5b1142444d
The original change failed due to tests triggering uninstalls in a
flaky way. While this was unique to the test and was not in production
code, some CLs were split off to solve the 'wait until all operations
have completed' problem more holistically to prevent this type of
flakiness from appearing in the future. The split out CLs were:
* https://chromium-review.googlesource.com/c/chromium/src/+/3682262
* https://chromium-review.googlesource.com/c/chromium/src/+/3681702
* https://chromium-review.googlesource.com/c/chromium/src/+/3669840
This change also added a few new features to help with the flakiness:
* The run loop in the command manager is now re-usable for multiple
calls to await commands flushed.
* A few cleanups and upgrades to test code for better outputting.
Original change's description:
> [dPWA] Install from sync command without the install task.
>
> This change pulls out the logic from the web_app_install_task and
> manager for installing an app from sync and puts it into one command.
> This allows quite a lot of simplification in the code and allows very
> thorough testing.
>
> There are mostly no functional changes in this CL, mostly refactor. The
> only functional change here is that other installations will no longer
> be able to happen at the same time as sync installations. Hooray!
>
> Bug: 1298130
> Change-Id: Iebdcdde76b53d856891d168b9d76b0a4cbc2b086
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3614659
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Marc Treib <treib@chromium.org>
> Commit-Queue: Daniel Murphy <dmurph@chromium.org>
> Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
> Reviewed-by: Phillis Tang <phillis@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1007948}
Bug: 1298130
Change-Id: I9a131c65fbe561ace732a3926c2a63cc7e1bf0b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3674018
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010118}
This reverts commit 5b1142444d.
Reason for revert: Suspecting as a culprit for https://crbug.com/1329642
Original change's description:
> [dPWA] Install from sync command without the install task.
>
> This change pulls out the logic from the web_app_install_task and
> manager for installing an app from sync and puts it into one command.
> This allows quite a lot of simplification in the code and allows very
> thorough testing.
>
> There are mostly no functional changes in this CL, mostly refactor. The
> only functional change here is that other installations will no longer
> be able to happen at the same time as sync installations. Hooray!
>
> Bug: 1298130
> Change-Id: Iebdcdde76b53d856891d168b9d76b0a4cbc2b086
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3614659
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Marc Treib <treib@chromium.org>
> Commit-Queue: Daniel Murphy <dmurph@chromium.org>
> Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
> Reviewed-by: Phillis Tang <phillis@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1007948}
Bug: 1298130, 1329642
Change-Id: I5796c3aaca9094d8129c5dab0b580dbfe56649ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3671337
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Roman Sorokin <rsorokin@chromium.org>
Commit-Queue: Roman Sorokin <rsorokin@chromium.org>
Auto-Submit: Roman Sorokin <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008181}
This change pulls out the logic from the web_app_install_task and
manager for installing an app from sync and puts it into one command.
This allows quite a lot of simplification in the code and allows very
thorough testing.
There are mostly no functional changes in this CL, mostly refactor. The
only functional change here is that other installations will no longer
be able to happen at the same time as sync installations. Hooray!
Bug: 1298130
Change-Id: Iebdcdde76b53d856891d168b9d76b0a4cbc2b086
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3614659
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007948}
The dimensions was changed from `auto dimensions = std::minmax(...)` in
crrev.com/c/3645338
The change was because of `std::minmax` returns a reference that became
invalid in the following if condition.
Using type `std::pair<int, int>` (instead of `auto`) will cast the
reference to value, so it can also fix the issue and looks better than
two variables.
Change-Id: I889c2a160fef492c286c1cfb9e2d75b7b14c9a8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3668606
Auto-Submit: Ella Ge <eirage@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Glenn Hartmann <hartmanng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007823}
This CL fixes the richer install bottom sheet not showing correctly
with flag "SkipServiceWorkerCheckAll" enabled.
The issue is due to InstallableManager not checking whether the
screenshots fetching was completed. It worked before since
`params.fetch_screenshots` always set together with `params.has_worker`
and worker checks was later/slower than the screenshots.
Bug: 1322139
Change-Id: Id0cbb48cd0f133d4be586e41e8e19b95b285f27c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645338
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1005273}
This moves the feature flags out of the android folder
and moves the "check_worker = !enabled"logic to the AppBannerManager
base class so they can be used in browsertests.
The flags should only be enabled on Android.
Bug: 1322139
Change-Id: Ia4fdd10de99355f5a19d71417dd33b15bdfe50fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3642178
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002791}
This CL replaces DidFinishNavigation with PrimaryPageChanged in
InstallableManager. Listening to PrimaryPageChanged is preferred to
listening to DidFinishNavigation and checking IsInPrimaryMainFrame,
!IsSameDocument, and HasCommitted.
Bug: 1269645
Change-Id: I67518a466faf69981fec40703ed6377244b2dfcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3631893
Commit-Queue: Hyowon Kim <hyowon@igalia.com>
Reviewed-by: Kevin McNee <mcnee@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001350}
Produced by running the following command
./tools/resources/svgo.py `find components/ -name '*.svg'`
Also fixing a couple new violations that cropped up in folders that
have already been fixed in previous CLs. Ultimately turning these from
warnings to errors seems best, to guarantee that such violations don't
crop up (any false positives should be addressed by excluding specific
files from these checks).
This is the last CL fixing existing svgo_presubmit.py violations, and
`git cl presubmit --files=*.svg` should no longer produce any warnings
or errors.
Bug: 1309977
Change-Id: I06a7a50eb7fbc5b9f1eee9e89e652f7b2262db25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3629911
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: John Lee <johntlee@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000481}
`is_installable_` and `should_installable_time_out_` is used to indicate
that whether it has service worker and whether the service worker check
timed out. Using "Installable" here is misleading.
Renaming them to `has_worker_` and `should_service_worker_time_out_`.
Beside, changing the order in TestInstallableManager.GetData
to match the real InstallableManager.
Bug: 1322139
Change-Id: I159f9a7c7fb9ec2f774ca3b2071637c3077510c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3625609
Commit-Queue: Ella Ge <eirage@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999746}
Now that build_java and jni_java have been moved out of base_java's
public_deps and base_java no longer contains annotations, remove deps on
base_java that are now unnecessary (Removed 169/608 base_java deps or ~27.8%).
Bug: 1038372
Change-Id: I520f9cd849c9f142948941af5d7fe108b3d8c390
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3623861
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Owners-Override: Peter Wen <wnwen@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#998944}
This CL moves jni_java from base_java's public_dep to a regular dep.
This means that targets which only need jni_java do not need to depend
on the entirety of base_java. A future CL will remove base_java from
targets that no longer need it as a result of this CL and this other CL
for build_java: https://crrev.com/c/3606468
By using dep_operations.py split and then dep_operations.py remove, this
CL avoided adding 326 instances of jni_java across 201 files.
Bug: 1038372
Change-Id: Ifd411a923dc834d37e0a4c80daf5797c355c6f52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3615049
Auto-Submit: Peter Wen <wnwen@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Owners-Override: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997965}
Create `FetchManifestAndInstallCommand` that uses a NoOpt CommandLock to
retrieve and validate manifest then enqueue a `WebAppInstallCommand`
that performs the install. This is used by omnibox install/menu app
install from users.
A follow-up CL will be made to replace
`WebAppInstallManager::InstallWebAppFromManifest` with this
new command and add tests.
Bug: 1298130
Change-Id: I40731e04430f7b1a80195185b1a710bd22f05a23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3609215
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Phillis Tang <phillis@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997094}
This CL moves build_java from being a public_dep of base_java to a
regular dep. This means other targets that need to depend on build_java
must do so explicitly. Since build_java and base_java are not closely
related, this de-coupling (and when jni annotations are similarly moved)
will reduce the number of targets that depend on base_java only for its
annotations, thus speeding up builds when making changes to base_java.
By using dep_operations.py, this CL avoided adding build_java to 224+
targets that already depended on base_java across 194 files. There are
more opportunities to remove unnecessary dependencies on build_java, but
that is left for future CLs in order to prioritize removing build_java
from base_java's public_deps.
Initial estimate (after jni_java is similarly moved out of public_deps)
is that we can remove more than 265+ dependencies on base_java across
~153 files.
Bug: 1038372
Change-Id: Ia5acc70af449f10363bd7e123473e0823ce31bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3606468
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Owners-Override: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996885}
installations.
Before we were only showing toasts for WebAPK installations scheduled
in Chrome. When the installation is already in progress, a toast is
shown and if the installation failed a shortcut is created. This
behavior did not change through this CL.
This CL implements showing toasts also when the installation was
scheduled in WebLayer. We show the same text as in Chrome if the
installation is already in progress. We also show a toast if the
installation failed instead of adding a shortcut, because we would
have to set the default application that should be used when opening
the shortcut, which could be Chrome, but Chrome might not be installed,
so for now the behavior is to just tell the user that the installation
failed via a Toast.
Bug: 1101999
Change-Id: I5688efaf20e06b255b8f2ac4772addda09fb3108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3579109
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995633}
WebApkInstallCoordinator-service in Chrome.
This CL enables the WebApk installation via BottomSheet/BannerUI or
Ambient Badge in Weblayer. If a website fulfills PWA criteria and
site-engagement is reached, preferably a bottom sheet with an install
button is shown, alternatively a BannerUI or Ambient Badge. When the
user triggers the install the WebAPK-proto is built in WebLayer and
passed, together with a callback, to Chrome's WebApkInstallCoordinator-
service.
(CL: https://chromium-review.googlesource.com/c/chromium/src/+/3503251)
The callback is called by the service as soon as the installation
finished or failed.
The binary size increase is caused by newly implemented classes, the
additional dependency of Promise.java (which is used for triggering the
nested callback functions when connecting to the Chrome-service and
the forwarding of the callback result which was received from the
service) and a dependency to //components/signin which seems to be
the result of some internal optimization of the build, but the overall
increase through that is within limits.
Follow up CLs:
- Display a Toast in the failure case and when the installation starts.
- Only show the install-banner if a Chrome version that contains the
service is installed on the device.
- UMA logging.
- BrowserTest for WebApkInstallScheduler.
Binary-Size: See commit description.
Bug: 1101999
Change-Id: I7cb9a48235873c607efd12c83332c0bfbdc23865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3542366
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#994580}
Weblayer
This CL adds an Android service that can be enabled with a features flag
via the command line if the build is a development build.
($BUILD_DIR/bin/chrome_apk run --args='--enable-features=\
WebApkInstallService')
The service receives the WebAPKs prebuild WebAPK-proto, its primary
icon, and a boolean if this icon is maskable from the client. (The
service is not able to build the proto itself in all cases as for some
websites e.g. login credentials have to be available so that the website
fulfill the PWA criteria.)
The service passes the values to the webapk_install_service that is then
handling the installation. After the installation succeeded or failed,
a callback function that the client passes to the service is invoked
with the result value, so that the client is able to handle the failure
case.
For UMA and UKM logging new sources in ShortcutInfo and
WebapkInstallSource have been added and installations and launches
are logged with these values.
Possible failure case is a too large payload (WebAPK + Icon) passed to
the service, which will result in a RemoteException that can be handled
by the client-app.
Bug: 1101999
Change-Id: Iac47ccab3fd5eb24447719bafa59c8992b14b559
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3503251
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#991041}
This patch fixes the incorrect assumption that we can determine the
installation source from the uninstallation location, and makes the
installation source a bit more required for install tasks and options.
This also updates some variable names from install_source to
install_surface, which is a more accurate name. Work to rename the whole
enum is in https://crbug.com/1313273.
The only functional change in this CL is in
externally_managed_app_install_task.cc:187, which sets the source of the
uninstall correctly now. This fixes an issue where replaced placeholder
apps aren't uninstalled correctly.
All other changes are purely refactoring.
Bug: 1312061
Change-Id: I82968bc91e12e8d60736ed32af9782312941d98e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3570646
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Tim Sergeant <tsergeant@chromium.org>
Reviewed-by: Jon Mann <jonmann@chromium.org>
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Edman Anjos <edman@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Tommy Martino <tmartino@chromium.org>
Reviewed-by: Aga Wronska <agawronska@chromium.org>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Glenn Hartmann <hartmanng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#989943}
The corresponding internal change to add it to the translation pipeline
can be found at go/ksrhy.
This change:
- adds Welsh to translation_expectations.pyl to fix presubmit errors
(this needs to be done to add it to the translation pipeline as well),
- adds Welsh as a translation to every GRD file listed under
desktop_grds in the aforementioned expectations file,
- creates placeholder XTB files to the aforementioned GRD files,
- and adds Welsh to default_embedded_i18_locales to fix a build error
with it missing. This is temporary and will be removed in the future
once we add Welsh to all_chrome_locales.
Note that this change does NOT add Welsh to the outputs of all files
like https://crrev.com/c/3498882, as doing so would expose some
assumptions that "the list of Android locales is the list of all Chrome
locales". That will come in a separate CL which will be merged once
those assumptions are fixed.
Bug: b/192306364
Change-Id: Ic818cff8d8beb5b757012a66b8db52caa03b48d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2988903
Reviewed-by: David Bienvenu <davidbienvenu@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Michael Cui <mlcui@google.com>
Cr-Commit-Position: refs/heads/main@{#989310}
The WebAPK installation result will be used in Chrome, as well as in
Weblayer when scheduling the install via the Chrome-Service, so the
enum is moved to components to make it accessible in the weblayer-folder.
The enum is also used in Clank, so the current enum is kept for now, with
the same entries, and after the CL in Clank landed it will be removed.
With the current implementation both imports are supported in Clank:
import org.chromium.components.webapps.WebApkInstallResult;
import org.chromium.chrome.browser.webapps.WebApkInstallResult;
Change-Id: I7bcf6be423faf1990f60d1dc3f7e70006abb13f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557277
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987563}
This reverts commit 8685f96136.
Reason for revert: Breaks quite a few of our integration tests. Most concerning is that sync doesn't seem to be working properly now. See bugs below
Original change's description:
> [Desktop PWAs] Implement short-term Create Shortcut fix.
>
> This CL implements the proposal outlined at
> go/create-shortcut-regression which boils down to:
> - The 'Install Site' menu option will appear for any app with a manifest
> and respect the manifest as much as possible (implemented by changing
> AppBannerManager's concept of Installability).
> - Create Shortcut will always use the current page's URL and ignore the
> majority of the manifest.
>
> See https://crbug.com/1216457#c44 for a more detailed description of the
> motivation behind these changes.
>
> Bug: 1216457
> Change-Id: Ibb0e4feca8fc41d89e88dca6f9bfba773f5bff0e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3508988
> Reviewed-by: Daniel Murphy <dmurph@chromium.org>
> Reviewed-by: Glen Robertson <glenrob@chromium.org>
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Commit-Queue: Christopher Lam <calamity@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#987275}
Bug: 1216457, 1311896, 1311892, 1311895, 1311899
Change-Id: Iad7ad3668a875dc66f92edf255043e0b266e97ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564363
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Owners-Override: Owen Min <zmin@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987561}
This CL is a no-op.
Only fixing instances where base::Time (and Ticks/Delta) is used in
a statement (i.e. not as a parameter to avoid adding includes in mere
overrides). Skipping pointer and reference qualified instances.
i.e. matches this regex:
'(\n *[^/\n][^/\n][^/\n]*base::(Time|Thread)(Ticks|Delta)?\b[^*&][^)]*;)'
and skipping files that have any existing fwd-decl for any of the
variants.
This is a prereq to remove unused base/task/post_task.h includes in
https://chromium-review.googlesource.com/c/chromium/src/+/3555247
Bug: 1026641
Change-Id: I87b43a8dc92bdceb67f4bd59b327b54813aa72a6
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557354
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987283}
This CL implements the proposal outlined at
go/create-shortcut-regression which boils down to:
- The 'Install Site' menu option will appear for any app with a manifest
and respect the manifest as much as possible (implemented by changing
AppBannerManager's concept of Installability).
- Create Shortcut will always use the current page's URL and ignore the
majority of the manifest.
See https://crbug.com/1216457#c44 for a more detailed description of the
motivation behind these changes.
Bug: 1216457
Change-Id: Ibb0e4feca8fc41d89e88dca6f9bfba773f5bff0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3508988
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Glen Robertson <glenrob@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Christopher Lam <calamity@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987275}
components
BuildProto-function is not specific to chrome and will also be needed
in Weblayer, so it was moved to components together with it's unittests.
No logic has been changed.
Tests: ninja -C out/Default components_unittests \
&& ./out/Default/bin/run_components_unittests \
--gtest_filter='*WebApkProtoBuilder*'
Bug: 1101999
Change-Id: I5337beaa35adffbd66dca769f42709959e71a6cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3507998
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982702}
If an app specifies...
<meta name="application-name" content=" ">
... that value (space) is not a great thing to use as a value
to suggest to the user as a name for the shortcut, and is ignored
by Firefox, for example.
This CL trims the whitespace before checking if string is empty.
Bug: 1253299
Change-Id: I9b232c12a3055d0980267cd0a415486551c13e94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3525397
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/main@{#981730}
This change takes the manifest parsed policy and sends it to the
PermissionsPolicyParser, which better handles input validation
and other concepts specific to Permissions Policy. The returned
value is then stored in the Web App Provider system.
* Remove blink::Manifest::PermissionsPolicyDeclaration in favor of
blink::ParsedPermissionsPolicyDeclaration.
* Refactor ManifestParser to take an ExecutionContext instead of
FeatureContext from ManifestManager, which is required in order to
to use the PermissionsPolicyParser method.
Bug: 1238341
Change-Id: Ic874bf4f89beb72f781645c32ab0d8c202ad494a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3415495
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Auto-Submit: Jarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980643}
Replace push_back(Class(args)) with emplace_back(args)
In method declarations, avoid declaring by-value arguments const.
Initialize various member variables at definition.
No need for std::move when called method accepts a const reference.
Declare various methods const.
Rename const InstallableData& method argument from 'result' to 'data'
for consistency with derived classes.
AppBannerManager:
Change-Id: I469ce61b6764df2e71f2205cf2470ba07e040837
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3509512
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#979474}
The AddToHomeschreenCoordinator will also be used from WebLayer, there
the WeblayerShellActivity and ModalDialogManagerHolder are loaded in
different ClassLoaders so the ModalDialogManager needs to be accessed
directly via the WindowActivty. The Context used to call
AddToHomeschreenCoordinator constructor needs to be the
WindowAndroid.getContext() as the WindowAndroid.getActivity() only is
the WeblayerShellActivity.
Bug: 1101999
Change-Id: I04ae68eeca3183de80c1e2bb6beadca51827f0f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3497038
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Susanne Westphal <swestphal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#977710}
Add new uninstall result codes:
- kNoAppToUninstall: a no-op uninstall, where an app could not be
uninstalled because it could not be found, which could be treated as a
success case.
- kCancelled: uninstall operation was cancelled (can be used in
dialogs using UninstallResultCode).
Bug: 1300760
Change-Id: Icd00b4dcf3cbd94447501272b2f5dd8b022d814b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3499681
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Alexander Bolodurin <alexbn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#977525}