OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/frame/FrameHost.h" | 31 #include "core/frame/FrameHost.h" |
32 | 32 |
| 33 #include "core/frame/BrowserControls.h" |
33 #include "core/frame/EventHandlerRegistry.h" | 34 #include "core/frame/EventHandlerRegistry.h" |
34 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
35 #include "core/frame/PageScaleConstraints.h" | 36 #include "core/frame/PageScaleConstraints.h" |
36 #include "core/frame/PageScaleConstraintsSet.h" | 37 #include "core/frame/PageScaleConstraintsSet.h" |
37 #include "core/frame/TopControls.h" | |
38 #include "core/frame/VisualViewport.h" | 38 #include "core/frame/VisualViewport.h" |
39 #include "core/inspector/ConsoleMessageStorage.h" | 39 #include "core/inspector/ConsoleMessageStorage.h" |
40 #include "core/page/Page.h" | 40 #include "core/page/Page.h" |
41 #include "core/page/scrolling/OverscrollController.h" | 41 #include "core/page/scrolling/OverscrollController.h" |
42 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | 42 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
44 #include "public/platform/WebScheduler.h" | 44 #include "public/platform/WebScheduler.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 FrameHost* FrameHost::create(Page& page) { | 48 FrameHost* FrameHost::create(Page& page) { |
49 return new FrameHost(page); | 49 return new FrameHost(page); |
50 } | 50 } |
51 | 51 |
52 FrameHost::FrameHost(Page& page) | 52 FrameHost::FrameHost(Page& page) |
53 : m_page(&page), | 53 : m_page(&page), |
54 m_topControls(TopControls::create(*this)), | 54 m_browserControls(BrowserControls::create(*this)), |
55 m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()), | 55 m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()), |
56 m_visualViewport(VisualViewport::create(*this)), | 56 m_visualViewport(VisualViewport::create(*this)), |
57 m_overscrollController( | 57 m_overscrollController( |
58 OverscrollController::create(*m_visualViewport, | 58 OverscrollController::create(*m_visualViewport, |
59 m_page->chromeClient())), | 59 m_page->chromeClient())), |
60 m_eventHandlerRegistry(new EventHandlerRegistry(*this)), | 60 m_eventHandlerRegistry(new EventHandlerRegistry(*this)), |
61 m_consoleMessageStorage(new ConsoleMessageStorage()), | 61 m_consoleMessageStorage(new ConsoleMessageStorage()), |
62 m_globalRootScrollerController( | 62 m_globalRootScrollerController( |
63 TopDocumentRootScrollerController::create(*this)), | 63 TopDocumentRootScrollerController::create(*this)), |
64 m_subframeCount(0) {} | 64 m_subframeCount(0) {} |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 const Deprecation& FrameHost::deprecation() const { | 105 const Deprecation& FrameHost::deprecation() const { |
106 return m_page->deprecation(); | 106 return m_page->deprecation(); |
107 } | 107 } |
108 | 108 |
109 float FrameHost::deviceScaleFactorDeprecated() const { | 109 float FrameHost::deviceScaleFactorDeprecated() const { |
110 return m_page->deviceScaleFactor(); | 110 return m_page->deviceScaleFactor(); |
111 } | 111 } |
112 | 112 |
113 TopControls& FrameHost::topControls() { | 113 BrowserControls& FrameHost::browserControls() { |
114 return *m_topControls; | 114 return *m_browserControls; |
115 } | 115 } |
116 | 116 |
117 const TopControls& FrameHost::topControls() const { | 117 const BrowserControls& FrameHost::browserControls() const { |
118 return *m_topControls; | 118 return *m_browserControls; |
119 } | 119 } |
120 | 120 |
121 OverscrollController& FrameHost::overscrollController() { | 121 OverscrollController& FrameHost::overscrollController() { |
122 return *m_overscrollController; | 122 return *m_overscrollController; |
123 } | 123 } |
124 | 124 |
125 const OverscrollController& FrameHost::overscrollController() const { | 125 const OverscrollController& FrameHost::overscrollController() const { |
126 return *m_overscrollController; | 126 return *m_overscrollController; |
127 } | 127 } |
128 | 128 |
(...skipping 29 matching lines...) Expand all Loading... |
158 return *m_consoleMessageStorage; | 158 return *m_consoleMessageStorage; |
159 } | 159 } |
160 | 160 |
161 TopDocumentRootScrollerController& FrameHost::globalRootScrollerController() | 161 TopDocumentRootScrollerController& FrameHost::globalRootScrollerController() |
162 const { | 162 const { |
163 return *m_globalRootScrollerController; | 163 return *m_globalRootScrollerController; |
164 } | 164 } |
165 | 165 |
166 DEFINE_TRACE(FrameHost) { | 166 DEFINE_TRACE(FrameHost) { |
167 visitor->trace(m_page); | 167 visitor->trace(m_page); |
168 visitor->trace(m_topControls); | 168 visitor->trace(m_browserControls); |
169 visitor->trace(m_visualViewport); | 169 visitor->trace(m_visualViewport); |
170 visitor->trace(m_overscrollController); | 170 visitor->trace(m_overscrollController); |
171 visitor->trace(m_eventHandlerRegistry); | 171 visitor->trace(m_eventHandlerRegistry); |
172 visitor->trace(m_consoleMessageStorage); | 172 visitor->trace(m_consoleMessageStorage); |
173 visitor->trace(m_globalRootScrollerController); | 173 visitor->trace(m_globalRootScrollerController); |
174 } | 174 } |
175 | 175 |
176 #if ENABLE(ASSERT) | 176 #if ENABLE(ASSERT) |
177 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { | 177 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { |
178 ASSERT(expectedFrameCount >= 0); | 178 ASSERT(expectedFrameCount >= 0); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | 229 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); |
230 | 230 |
231 if (!rootView) | 231 if (!rootView) |
232 return; | 232 return; |
233 | 233 |
234 rootView->setNeedsLayout(); | 234 rootView->setNeedsLayout(); |
235 } | 235 } |
236 | 236 |
237 } // namespace blink | 237 } // namespace blink |
OLD | NEW |