Commit 8db140f4 authored by Jay Harris's avatar Jay Harris Committed by Commit Bot

Removes 'cause' from launchParams.

The explainer is being updated to indicate that websites should use
the presence of 'files' and 'request' to determine the cause of
launches.

Note: This API is hidden behind the NativeFileSystemAPI and
FileHandling blink flags.

Bug: 829689
Change-Id: Ia8a39ce36fee06281ab51e03c3ad2db401c105c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1672611
Commit-Queue: Jay Harris <harrisjay@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671988}
parent b078723d
...@@ -900,17 +900,9 @@ IN_PROC_BROWSER_TEST_P(HostedAppFileHandlingTest, PWAsCanViewLaunchParams) { ...@@ -900,17 +900,9 @@ IN_PROC_BROWSER_TEST_P(HostedAppFileHandlingTest, PWAsCanViewLaunchParams) {
OpenApplicationWindow(params, web_app_info.file_handler->action); OpenApplicationWindow(params, web_app_info.file_handler->action);
navigation_observer.Wait(); navigation_observer.Wait();
base::Value expected(base::Value::Type::DICTIONARY); EXPECT_EQ(0, content::EvalJs(
expected.SetStringKey("cause", "default");
expected.SetIntKey("length", 0);
EXPECT_EQ(expected,
content::EvalJsWithManualReply(
web_contents, web_contents,
"getLaunchParams().then(params => {" "getLaunchParams().then(params => params.files.length)"));
"domAutomationController.send({ cause: params.cause, length: "
"params.files.length });"
"});"));
} }
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
......
...@@ -80,7 +80,7 @@ DOMWindowLaunchParams* DOMWindowLaunchParams::FromState( ...@@ -80,7 +80,7 @@ DOMWindowLaunchParams* DOMWindowLaunchParams::FromState(
// params from the browser process, use that instead of hard coding the // params from the browser process, use that instead of hard coding the
// launch params. // launch params.
supplement->launch_params_ = MakeGarbageCollected<LaunchParams>( supplement->launch_params_ = MakeGarbageCollected<LaunchParams>(
"default", HeapVector<Member<NativeFileSystemHandle>>()); HeapVector<Member<NativeFileSystemHandle>>());
} }
return supplement; return supplement;
} }
......
...@@ -9,9 +9,8 @@ ...@@ -9,9 +9,8 @@
namespace blink { namespace blink {
LaunchParams::LaunchParams(String cause, LaunchParams::LaunchParams(HeapVector<Member<NativeFileSystemHandle>> files)
HeapVector<Member<NativeFileSystemHandle>> files) : files_(files) {}
: cause_(cause), files_(files) {}
LaunchParams::~LaunchParams() = default; LaunchParams::~LaunchParams() = default;
......
...@@ -19,17 +19,15 @@ class LaunchParams final : public ScriptWrappable { ...@@ -19,17 +19,15 @@ class LaunchParams final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
LaunchParams(String cause, HeapVector<Member<NativeFileSystemHandle>> files); LaunchParams(HeapVector<Member<NativeFileSystemHandle>> files);
~LaunchParams() override; ~LaunchParams() override;
// LaunchParams IDL interface. // LaunchParams IDL interface.
const String& cause() { return cause_; }
const HeapVector<Member<NativeFileSystemHandle>>& files() { return files_; } const HeapVector<Member<NativeFileSystemHandle>>& files() { return files_; }
void Trace(blink::Visitor*) override; void Trace(blink::Visitor*) override;
private: private:
String cause_;
HeapVector<Member<NativeFileSystemHandle>> files_; HeapVector<Member<NativeFileSystemHandle>> files_;
}; };
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
// Explainer: https://github.com/WICG/file-handling/blob/master/explainer.md // Explainer: https://github.com/WICG/file-handling/blob/master/explainer.md
[RuntimeEnabled=FileHandling] interface LaunchParams { [RuntimeEnabled=FileHandling] interface LaunchParams {
readonly attribute DOMString cause;
[SameObject] [SameObject]
readonly attribute FrozenArray<FileSystemBaseHandle> files; readonly attribute FrozenArray<FileSystemBaseHandle> files;
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment