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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "core/frame/EventHandlerRegistry.h" | 33 #include "core/frame/EventHandlerRegistry.h" |
34 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
35 #include "core/frame/PageScaleConstraints.h" | 35 #include "core/frame/PageScaleConstraints.h" |
36 #include "core/frame/PageScaleConstraintsSet.h" | 36 #include "core/frame/PageScaleConstraintsSet.h" |
37 #include "core/frame/TopControls.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 "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
43 #include "public/platform/WebScheduler.h" | 44 #include "public/platform/WebScheduler.h" |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 FrameHost* FrameHost::create(Page& page) | 48 FrameHost* FrameHost::create(Page& page) |
48 { | 49 { |
49 return new FrameHost(page); | 50 return new FrameHost(page); |
50 } | 51 } |
51 | 52 |
52 FrameHost::FrameHost(Page& page) | 53 FrameHost::FrameHost(Page& page) |
53 : m_page(&page) | 54 : m_page(&page) |
54 , m_topControls(TopControls::create(*this)) | 55 , m_topControls(TopControls::create(*this)) |
55 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) | 56 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) |
56 , m_visualViewport(VisualViewport::create(*this)) | 57 , m_visualViewport(VisualViewport::create(*this)) |
57 , m_overscrollController(OverscrollController::create( | 58 , m_overscrollController(OverscrollController::create( |
58 *m_visualViewport, | 59 *m_visualViewport, |
59 m_page->chromeClient())) | 60 m_page->chromeClient())) |
60 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) | 61 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) |
61 , m_consoleMessageStorage(new ConsoleMessageStorage()) | 62 , m_consoleMessageStorage(new ConsoleMessageStorage()) |
| 63 , m_globalRootScrollerController( |
| 64 TopDocumentRootScrollerController::create(*this)) |
62 , m_subframeCount(0) | 65 , m_subframeCount(0) |
63 { | 66 { |
64 } | 67 } |
65 | 68 |
66 // Explicitly in the .cpp to avoid default constructor in .h | 69 // Explicitly in the .cpp to avoid default constructor in .h |
67 FrameHost::~FrameHost() | 70 FrameHost::~FrameHost() |
68 { | 71 { |
69 } | 72 } |
70 | 73 |
71 Page& FrameHost::page() | 74 Page& FrameHost::page() |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 ConsoleMessageStorage& FrameHost::consoleMessageStorage() | 179 ConsoleMessageStorage& FrameHost::consoleMessageStorage() |
177 { | 180 { |
178 return *m_consoleMessageStorage; | 181 return *m_consoleMessageStorage; |
179 } | 182 } |
180 | 183 |
181 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const | 184 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const |
182 { | 185 { |
183 return *m_consoleMessageStorage; | 186 return *m_consoleMessageStorage; |
184 } | 187 } |
185 | 188 |
| 189 TopDocumentRootScrollerController& FrameHost::globalRootScrollerController() con
st |
| 190 { |
| 191 return *m_globalRootScrollerController; |
| 192 } |
| 193 |
186 DEFINE_TRACE(FrameHost) | 194 DEFINE_TRACE(FrameHost) |
187 { | 195 { |
188 visitor->trace(m_page); | 196 visitor->trace(m_page); |
189 visitor->trace(m_topControls); | 197 visitor->trace(m_topControls); |
190 visitor->trace(m_visualViewport); | 198 visitor->trace(m_visualViewport); |
191 visitor->trace(m_overscrollController); | 199 visitor->trace(m_overscrollController); |
192 visitor->trace(m_eventHandlerRegistry); | 200 visitor->trace(m_eventHandlerRegistry); |
193 visitor->trace(m_consoleMessageStorage); | 201 visitor->trace(m_consoleMessageStorage); |
| 202 visitor->trace(m_globalRootScrollerController); |
194 } | 203 } |
195 | 204 |
196 #if ENABLE(ASSERT) | 205 #if ENABLE(ASSERT) |
197 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) | 206 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) |
198 { | 207 { |
199 ASSERT(expectedFrameCount >= 0); | 208 ASSERT(expectedFrameCount >= 0); |
200 | 209 |
201 int actualFrameCount = 0; | 210 int actualFrameCount = 0; |
202 for (; frame; frame = frame->tree().traverseNext()) | 211 for (; frame; frame = frame->tree().traverseNext()) |
203 ++actualFrameCount; | 212 ++actualFrameCount; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 259 |
251 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | 260 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); |
252 | 261 |
253 if (!rootView) | 262 if (!rootView) |
254 return; | 263 return; |
255 | 264 |
256 rootView->setNeedsLayout(); | 265 rootView->setNeedsLayout(); |
257 } | 266 } |
258 | 267 |
259 } // namespace blink | 268 } // namespace blink |
OLD | NEW |