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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 if (!document || !controller()) { | 77 if (!document || !controller()) { |
78 DOMException* exception = DOMException::create( | 78 DOMException* exception = DOMException::create( |
79 InvalidStateError, "The object is no longer associated to a document."); | 79 InvalidStateError, "The object is no longer associated to a document."); |
80 resolver->reject(exception); | 80 resolver->reject(exception); |
81 return promise; | 81 return promise; |
82 } | 82 } |
83 | 83 |
84 controller()->getInstalledApps( | 84 controller()->getInstalledApps( |
85 WebSecurityOrigin( | 85 WebSecurityOrigin( |
86 scriptState->getExecutionContext()->getSecurityOrigin()), | 86 scriptState->getExecutionContext()->getSecurityOrigin()), |
87 wrapUnique(new CallbackPromiseAdapter<RelatedAppArray, void>(resolver))); | 87 WTF::wrapUnique( |
| 88 new CallbackPromiseAdapter<RelatedAppArray, void>(resolver))); |
88 return promise; | 89 return promise; |
89 } | 90 } |
90 | 91 |
91 InstalledAppController* NavigatorInstalledApp::controller() { | 92 InstalledAppController* NavigatorInstalledApp::controller() { |
92 if (!frame()) | 93 if (!frame()) |
93 return nullptr; | 94 return nullptr; |
94 | 95 |
95 return InstalledAppController::from(*frame()); | 96 return InstalledAppController::from(*frame()); |
96 } | 97 } |
97 | 98 |
98 const char* NavigatorInstalledApp::supplementName() { | 99 const char* NavigatorInstalledApp::supplementName() { |
99 return "NavigatorInstalledApp"; | 100 return "NavigatorInstalledApp"; |
100 } | 101 } |
101 | 102 |
102 DEFINE_TRACE(NavigatorInstalledApp) { | 103 DEFINE_TRACE(NavigatorInstalledApp) { |
103 Supplement<Navigator>::trace(visitor); | 104 Supplement<Navigator>::trace(visitor); |
104 DOMWindowProperty::trace(visitor); | 105 DOMWindowProperty::trace(visitor); |
105 } | 106 } |
106 | 107 |
107 } // namespace blink | 108 } // namespace blink |
OLD | NEW |