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" |
11 #include "core/dom/DOMException.h" | 11 #include "core/dom/DOMException.h" |
12 #include "core/dom/Document.h" | 12 #include "core/dom/Document.h" |
13 #include "core/dom/ExceptionCode.h" | 13 #include "core/dom/ExceptionCode.h" |
14 #include "core/dom/ExecutionContext.h" | |
15 #include "core/frame/LocalDOMWindow.h" | 14 #include "core/frame/LocalDOMWindow.h" |
16 #include "core/frame/LocalFrame.h" | 15 #include "core/frame/LocalFrame.h" |
17 #include "core/frame/Navigator.h" | 16 #include "core/frame/Navigator.h" |
18 #include "modules/installedapp/InstalledAppController.h" | 17 #include "modules/installedapp/InstalledAppController.h" |
19 #include "modules/installedapp/RelatedApplication.h" | 18 #include "modules/installedapp/RelatedApplication.h" |
20 #include "platform/wtf/PtrUtil.h" | 19 #include "platform/wtf/PtrUtil.h" |
21 #include "public/platform/modules/installedapp/WebRelatedApplication.h" | 20 #include "public/platform/modules/installedapp/WebRelatedApplication.h" |
22 | 21 |
23 namespace blink { | 22 namespace blink { |
24 | 23 |
(...skipping 14 matching lines...) Expand all Loading... |
39 supplement = new NavigatorInstalledApp(navigator); | 38 supplement = new NavigatorInstalledApp(navigator); |
40 ProvideTo(navigator, SupplementName(), supplement); | 39 ProvideTo(navigator, SupplementName(), supplement); |
41 } | 40 } |
42 return *supplement; | 41 return *supplement; |
43 } | 42 } |
44 | 43 |
45 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( | 44 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( |
46 ScriptState* script_state, | 45 ScriptState* script_state, |
47 Navigator& navigator) { | 46 Navigator& navigator) { |
48 // [SecureContext] from the IDL ensures this. | 47 // [SecureContext] from the IDL ensures this. |
49 DCHECK(ExecutionContext::From(script_state)->IsSecureContext()); | 48 DCHECK(script_state->GetExecutionContext()->IsSecureContext()); |
50 return NavigatorInstalledApp::From(navigator).getInstalledRelatedApps( | 49 return NavigatorInstalledApp::From(navigator).getInstalledRelatedApps( |
51 script_state); | 50 script_state); |
52 } | 51 } |
53 | 52 |
54 class RelatedAppArray { | 53 class RelatedAppArray { |
55 STATIC_ONLY(RelatedAppArray); | 54 STATIC_ONLY(RelatedAppArray); |
56 | 55 |
57 public: | 56 public: |
58 using WebType = const WebVector<WebRelatedApplication>&; | 57 using WebType = const WebVector<WebRelatedApplication>&; |
59 | 58 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 104 |
106 const char* NavigatorInstalledApp::SupplementName() { | 105 const char* NavigatorInstalledApp::SupplementName() { |
107 return "NavigatorInstalledApp"; | 106 return "NavigatorInstalledApp"; |
108 } | 107 } |
109 | 108 |
110 DEFINE_TRACE(NavigatorInstalledApp) { | 109 DEFINE_TRACE(NavigatorInstalledApp) { |
111 Supplement<Navigator>::Trace(visitor); | 110 Supplement<Navigator>::Trace(visitor); |
112 } | 111 } |
113 | 112 |
114 } // namespace blink | 113 } // namespace blink |
OLD | NEW |