OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/installedapp/NavigatorInstalledApp.h" | 5 #include "modules/installedapp/NavigatorInstalledApp.h" |
6 | 6 |
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 STATIC_ONLY(RelatedAppArray); | 53 STATIC_ONLY(RelatedAppArray); |
54 | 54 |
55 public: | 55 public: |
56 using WebType = const WebVector<WebRelatedApplication>&; | 56 using WebType = const WebVector<WebRelatedApplication>&; |
57 | 57 |
58 static HeapVector<Member<RelatedApplication>> take( | 58 static HeapVector<Member<RelatedApplication>> take( |
59 ScriptPromiseResolver*, | 59 ScriptPromiseResolver*, |
60 const WebVector<WebRelatedApplication>& webInfo) { | 60 const WebVector<WebRelatedApplication>& webInfo) { |
61 HeapVector<Member<RelatedApplication>> applications; | 61 HeapVector<Member<RelatedApplication>> applications; |
62 for (const auto& webApplication : webInfo) | 62 for (const auto& webApplication : webInfo) |
63 applications.append(RelatedApplication::create( | 63 applications.push_back(RelatedApplication::create( |
64 webApplication.platform, webApplication.url, webApplication.id)); | 64 webApplication.platform, webApplication.url, webApplication.id)); |
65 return applications; | 65 return applications; |
66 } | 66 } |
67 }; | 67 }; |
68 | 68 |
69 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( | 69 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( |
70 ScriptState* scriptState) { | 70 ScriptState* scriptState) { |
71 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 71 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
72 ScriptPromise promise = resolver->promise(); | 72 ScriptPromise promise = resolver->promise(); |
73 | 73 |
(...skipping 22 matching lines...) Expand all Loading... |
96 | 96 |
97 const char* NavigatorInstalledApp::supplementName() { | 97 const char* NavigatorInstalledApp::supplementName() { |
98 return "NavigatorInstalledApp"; | 98 return "NavigatorInstalledApp"; |
99 } | 99 } |
100 | 100 |
101 DEFINE_TRACE(NavigatorInstalledApp) { | 101 DEFINE_TRACE(NavigatorInstalledApp) { |
102 Supplement<Navigator>::trace(visitor); | 102 Supplement<Navigator>::trace(visitor); |
103 } | 103 } |
104 | 104 |
105 } // namespace blink | 105 } // namespace blink |
OLD | NEW |