| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |