WebApps: Enables/disables file handling depending on trial validity.
File handling is a slightly different to other features which go into
origin trial: The underlying OS holds state to let it identify handlers
for different file types.
This CL cleans up that state when an origin trial expires, so that apps
which don't have a valid trial, don't show up as file handlers in the
operating system.
On navigation to a page inside an installed app with file handlers,
we store the time that the trial expires. If the trial has
already expired, we unregister the file handlers. If the trial is valid,
but the app's file handlers are not registered, we register them.
On Chrome start up, we unregister file handlers for all apps for
which the origin trial has past it's expiry date.
This ensures that apps without a valid origin trial token will show up
in the open with menu at most one Chrome restart, or until the user
visits the site again, whichever happens first.
Bug: 1028448
Change-Id: I6e2d19d7462d1f94955f1ca51abffd2a4c53096d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1940001
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Giovanni Ortuño Urquidi <[email protected]>
Commit-Queue: Jay Harris <[email protected]>
Cr-Commit-Position: refs/heads/master@{#739137}
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn
index 30301a0..e480591 100644
--- a/third_party/blink/public/mojom/BUILD.gn
+++ b/third_party/blink/public/mojom/BUILD.gn
@@ -145,6 +145,7 @@
"user_agent/user_agent_metadata.mojom",
"v8_cache_options.mojom",
"wake_lock/wake_lock.mojom",
+ "web_launch/file_handling_expiry.mojom",
"web_launch/web_launch.mojom",
"webaudio/audio_context_manager.mojom",
"webdatabase/web_database.mojom",