| 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 #ifndef AppBannerPromptResult_h | 5 #ifndef AppBannerPromptResult_h |
| 6 #define AppBannerPromptResult_h | 6 #define AppBannerPromptResult_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "public/platform/modules/app_banner/WebAppBannerPromptResult.h" | 9 #include "public/platform/modules/app_banner/WebAppBannerPromptResult.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| 11 #include "wtf/OwnPtr.h" |
| 11 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 12 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class ScriptPromiseResolver; | 17 class ScriptPromiseResolver; |
| 17 | 18 |
| 18 class AppBannerPromptResult final : public GarbageCollectedFinalized<AppBannerPr
omptResult>, public ScriptWrappable { | 19 class AppBannerPromptResult final : public GarbageCollectedFinalized<AppBannerPr
omptResult>, public ScriptWrappable { |
| 19 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 20 WTF_MAKE_NONCOPYABLE(AppBannerPromptResult); | 21 WTF_MAKE_NONCOPYABLE(AppBannerPromptResult); |
| 21 public: | 22 public: |
| 22 // Support for CallbackPromiseAdapter: | 23 // Support for CallbackPromiseAdapter: |
| 23 typedef blink::WebAppBannerPromptResult WebType; | 24 using WebType = OwnPtr<blink::WebAppBannerPromptResult>; |
| 24 static AppBannerPromptResult* take(ScriptPromiseResolver*, PassOwnPtr<WebApp
BannerPromptResult> webInstance); | 25 static AppBannerPromptResult* take(ScriptPromiseResolver*, PassOwnPtr<WebApp
BannerPromptResult> webInstance); |
| 25 | 26 |
| 26 static AppBannerPromptResult* create(const AtomicString& platform, WebAppBan
nerPromptResult::Outcome outcome) | 27 static AppBannerPromptResult* create(const AtomicString& platform, WebAppBan
nerPromptResult::Outcome outcome) |
| 27 { | 28 { |
| 28 return new AppBannerPromptResult(platform, outcome); | 29 return new AppBannerPromptResult(platform, outcome); |
| 29 } | 30 } |
| 30 | 31 |
| 31 virtual ~AppBannerPromptResult(); | 32 virtual ~AppBannerPromptResult(); |
| 32 | 33 |
| 33 String platform() const { return m_platform; } | 34 String platform() const { return m_platform; } |
| 34 String outcome() const; | 35 String outcome() const; |
| 35 | 36 |
| 36 DEFINE_INLINE_VIRTUAL_TRACE() { } | 37 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 AppBannerPromptResult(const AtomicString& platform, WebAppBannerPromptResult
::Outcome); | 40 AppBannerPromptResult(const AtomicString& platform, WebAppBannerPromptResult
::Outcome); |
| 40 | 41 |
| 41 String m_platform; | 42 String m_platform; |
| 42 WebAppBannerPromptResult::Outcome m_outcome; | 43 WebAppBannerPromptResult::Outcome m_outcome; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace blink | 46 } // namespace blink |
| 46 | 47 |
| 47 #endif // AppBannerPromptResult_h | 48 #endif // AppBannerPromptResult_h |
| OLD | NEW |