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/plugins/NavigatorPlugins.h" | 5 #include "modules/plugins/NavigatorPlugins.h" |
6 | 6 |
7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
8 #include "core/frame/Navigator.h" | 8 #include "core/frame/Navigator.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "modules/plugins/DOMMimeTypeArray.h" | 10 #include "modules/plugins/DOMMimeTypeArray.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 if (!supplement) { | 28 if (!supplement) { |
29 supplement = new NavigatorPlugins(navigator); | 29 supplement = new NavigatorPlugins(navigator); |
30 provideTo(navigator, supplementName(), supplement); | 30 provideTo(navigator, supplementName(), supplement); |
31 } | 31 } |
32 return *supplement; | 32 return *supplement; |
33 } | 33 } |
34 | 34 |
35 // static | 35 // static |
36 NavigatorPlugins* NavigatorPlugins::toNavigatorPlugins(Navigator& navigator) | 36 NavigatorPlugins* NavigatorPlugins::toNavigatorPlugins(Navigator& navigator) |
37 { | 37 { |
38 return static_cast<NavigatorPlugins*>(HeapSupplement<Navigator>::from(naviga
tor, supplementName())); | 38 return static_cast<NavigatorPlugins*>(Supplement<Navigator>::from(navigator,
supplementName())); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 const char* NavigatorPlugins::supplementName() | 42 const char* NavigatorPlugins::supplementName() |
43 { | 43 { |
44 return "NavigatorPlugins"; | 44 return "NavigatorPlugins"; |
45 } | 45 } |
46 | 46 |
47 // static | 47 // static |
48 DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) | 48 DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) |
(...skipping 24 matching lines...) Expand all Loading... |
73 { | 73 { |
74 if (!m_mimeTypes) | 74 if (!m_mimeTypes) |
75 m_mimeTypes = DOMMimeTypeArray::create(frame); | 75 m_mimeTypes = DOMMimeTypeArray::create(frame); |
76 return m_mimeTypes.get(); | 76 return m_mimeTypes.get(); |
77 } | 77 } |
78 | 78 |
79 DEFINE_TRACE(NavigatorPlugins) | 79 DEFINE_TRACE(NavigatorPlugins) |
80 { | 80 { |
81 visitor->trace(m_plugins); | 81 visitor->trace(m_plugins); |
82 visitor->trace(m_mimeTypes); | 82 visitor->trace(m_mimeTypes); |
83 HeapSupplement<Navigator>::trace(visitor); | 83 Supplement<Navigator>::trace(visitor); |
84 DOMWindowProperty::trace(visitor); | 84 DOMWindowProperty::trace(visitor); |
85 } | 85 } |
86 | 86 |
87 } // namespace blink | 87 } // namespace blink |
OLD | NEW |