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

Side by Side Diff: third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp

Issue 2747353002: Make BeforeInstallPromptEvent cancelable (Closed)
Patch Set: Comments Created 3 years, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/app_banner/BeforeInstallPromptEvent.h" 5 #include "modules/app_banner/BeforeInstallPromptEvent.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 17 matching lines...) Expand all
28 UserChoiceProperty::kUserChoice)), 28 UserChoiceProperty::kUserChoice)),
29 prompt_called_(false) { 29 prompt_called_(false) {
30 DCHECK(banner_service_); 30 DCHECK(banner_service_);
31 DCHECK(binding_.is_bound()); 31 DCHECK(binding_.is_bound());
32 UseCounter::Count(&frame, UseCounter::kBeforeInstallPromptEvent); 32 UseCounter::Count(&frame, UseCounter::kBeforeInstallPromptEvent);
33 } 33 }
34 34
35 BeforeInstallPromptEvent::BeforeInstallPromptEvent( 35 BeforeInstallPromptEvent::BeforeInstallPromptEvent(
36 const AtomicString& name, 36 const AtomicString& name,
37 const BeforeInstallPromptEventInit& init) 37 const BeforeInstallPromptEventInit& init)
38 : Event(name, false, true), binding_(this), prompt_called_(false) { 38 : Event(name, init), binding_(this), prompt_called_(false) {
39 if (init.hasPlatforms()) 39 if (init.hasPlatforms())
40 platforms_ = init.platforms(); 40 platforms_ = init.platforms();
41 } 41 }
42 42
43 BeforeInstallPromptEvent::~BeforeInstallPromptEvent() {} 43 BeforeInstallPromptEvent::~BeforeInstallPromptEvent() {}
44 44
45 void BeforeInstallPromptEvent::Dispose() { 45 void BeforeInstallPromptEvent::Dispose() {
46 banner_service_.reset(); 46 banner_service_.reset();
47 binding_.Close(); 47 binding_.Close();
48 } 48 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 user_choice_->Resolve(AppBannerPromptResult::Create( 104 user_choice_->Resolve(AppBannerPromptResult::Create(
105 g_empty_atom, AppBannerPromptResult::Outcome::kDismissed)); 105 g_empty_atom, AppBannerPromptResult::Outcome::kDismissed));
106 } 106 }
107 107
108 DEFINE_TRACE(BeforeInstallPromptEvent) { 108 DEFINE_TRACE(BeforeInstallPromptEvent) {
109 visitor->Trace(user_choice_); 109 visitor->Trace(user_choice_);
110 Event::Trace(visitor); 110 Event::Trace(visitor);
111 } 111 }
112 112
113 } // namespace blink 113 } // namespace blink
OLDNEW
« 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