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

Unified Diff: third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp

Issue 2747353002: Make BeforeInstallPromptEvent cancelable (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/app_banner/before-install-prompt-event-constructor.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
diff --git a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
index 1d78fb2383aaa40a9aa9c30acaecacf0d0cdabed..405e3ef3cf1f563f5f95eb15ccde5e65370d984e 100644
--- a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
+++ b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp
@@ -34,7 +34,7 @@ BeforeInstallPromptEvent::BeforeInstallPromptEvent(
BeforeInstallPromptEvent::BeforeInstallPromptEvent(
const AtomicString& name,
const BeforeInstallPromptEventInit& init)
- : Event(name, false, true), m_binding(this), m_promptCalled(false) {
+ : Event(name, init), m_binding(this), m_promptCalled(false) {
if (init.hasPlatforms())
m_platforms = init.platforms();
}
@@ -59,7 +59,7 @@ ScriptPromise BeforeInstallPromptEvent::userChoice(ScriptState* scriptState) {
return m_userChoice->promise(scriptState->world());
return ScriptPromise::rejectWithDOMException(
scriptState,
- DOMException::create(InvalidStateError,
+ DOMException::create(NotAllowedError,
Matt Giuca 2017/04/26 05:28:50 This is technically a breaking change (though NOBO
Matt Giuca 2017/05/11 01:42:05 Per https://crbug.com/658639, this bug was a mista
dominickn 2017/05/11 01:51:57 Done.
"userChoice cannot be accessed on this event."));
}
@@ -69,7 +69,7 @@ ScriptPromise BeforeInstallPromptEvent::prompt(ScriptState* scriptState) {
if (!defaultPrevented() || m_promptCalled || !m_bannerService.is_bound()) {
return ScriptPromise::rejectWithDOMException(
scriptState,
- DOMException::create(InvalidStateError,
+ DOMException::create(NotAllowedError,
"The prompt() method may only be called once, "
"following preventDefault()."));
}
« no previous file with comments | « third_party/WebKit/LayoutTests/app_banner/before-install-prompt-event-constructor.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698