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 17 matching lines...) Expand all Loading... |
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/EventHandlerRegistry.h" | 33 #include "core/frame/EventHandlerRegistry.h" |
34 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
35 #include "core/frame/TopControls.h" | 35 #include "core/frame/TopControls.h" |
36 #include "core/inspector/ConsoleMessageStorage.h" | 36 #include "core/inspector/ConsoleMessageStorage.h" |
37 #include "core/page/Page.h" | 37 #include "core/page/Page.h" |
| 38 #include "core/page/scrolling/OverscrollController.h" |
38 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
39 #include "public/platform/WebScheduler.h" | 40 #include "public/platform/WebScheduler.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 FrameHost* FrameHost::create(Page& page) | 44 FrameHost* FrameHost::create(Page& page) |
44 { | 45 { |
45 return new FrameHost(page); | 46 return new FrameHost(page); |
46 } | 47 } |
47 | 48 |
48 FrameHost::FrameHost(Page& page) | 49 FrameHost::FrameHost(Page& page) |
49 : m_page(&page) | 50 : m_page(&page) |
50 , m_topControls(TopControls::create(*this)) | 51 , m_topControls(TopControls::create(*this)) |
51 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) | 52 , m_pageScaleConstraintsSet(PageScaleConstraintsSet::create()) |
52 , m_visualViewport(VisualViewport::create(*this)) | 53 , m_visualViewport(VisualViewport::create(*this)) |
| 54 , m_overscrollController(OverscrollController::create( |
| 55 *m_visualViewport, |
| 56 m_page->chromeClient())) |
53 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) | 57 , m_eventHandlerRegistry(new EventHandlerRegistry(*this)) |
54 , m_consoleMessageStorage(ConsoleMessageStorage::create()) | 58 , m_consoleMessageStorage(ConsoleMessageStorage::create()) |
55 , m_subframeCount(0) | 59 , m_subframeCount(0) |
56 { | 60 { |
57 } | 61 } |
58 | 62 |
59 // Explicitly in the .cpp to avoid default constructor in .h | 63 // Explicitly in the .cpp to avoid default constructor in .h |
60 FrameHost::~FrameHost() | 64 FrameHost::~FrameHost() |
61 { | 65 { |
62 } | 66 } |
(...skipping 21 matching lines...) Expand all Loading... |
84 float FrameHost::deviceScaleFactor() const | 88 float FrameHost::deviceScaleFactor() const |
85 { | 89 { |
86 return m_page->deviceScaleFactor(); | 90 return m_page->deviceScaleFactor(); |
87 } | 91 } |
88 | 92 |
89 TopControls& FrameHost::topControls() const | 93 TopControls& FrameHost::topControls() const |
90 { | 94 { |
91 return *m_topControls; | 95 return *m_topControls; |
92 } | 96 } |
93 | 97 |
| 98 OverscrollController& FrameHost::overscrollController() const |
| 99 { |
| 100 return *m_overscrollController; |
| 101 } |
| 102 |
94 VisualViewport& FrameHost::visualViewport() const | 103 VisualViewport& FrameHost::visualViewport() const |
95 { | 104 { |
96 return *m_visualViewport; | 105 return *m_visualViewport; |
97 } | 106 } |
98 | 107 |
99 PageScaleConstraintsSet& FrameHost::pageScaleConstraintsSet() const | 108 PageScaleConstraintsSet& FrameHost::pageScaleConstraintsSet() const |
100 { | 109 { |
101 return *m_pageScaleConstraintsSet; | 110 return *m_pageScaleConstraintsSet; |
102 } | 111 } |
103 | 112 |
104 EventHandlerRegistry& FrameHost::eventHandlerRegistry() const | 113 EventHandlerRegistry& FrameHost::eventHandlerRegistry() const |
105 { | 114 { |
106 return *m_eventHandlerRegistry; | 115 return *m_eventHandlerRegistry; |
107 } | 116 } |
108 | 117 |
109 ConsoleMessageStorage& FrameHost::consoleMessageStorage() const | 118 ConsoleMessageStorage& FrameHost::consoleMessageStorage() const |
110 { | 119 { |
111 return *m_consoleMessageStorage; | 120 return *m_consoleMessageStorage; |
112 } | 121 } |
113 | 122 |
114 DEFINE_TRACE(FrameHost) | 123 DEFINE_TRACE(FrameHost) |
115 { | 124 { |
116 visitor->trace(m_page); | 125 visitor->trace(m_page); |
117 visitor->trace(m_topControls); | 126 visitor->trace(m_topControls); |
118 visitor->trace(m_visualViewport); | 127 visitor->trace(m_visualViewport); |
| 128 visitor->trace(m_overscrollController); |
119 visitor->trace(m_eventHandlerRegistry); | 129 visitor->trace(m_eventHandlerRegistry); |
120 visitor->trace(m_consoleMessageStorage); | 130 visitor->trace(m_consoleMessageStorage); |
121 } | 131 } |
122 | 132 |
123 #if ENABLE(ASSERT) | 133 #if ENABLE(ASSERT) |
124 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) | 134 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) |
125 { | 135 { |
126 ASSERT(expectedFrameCount >= 0); | 136 ASSERT(expectedFrameCount >= 0); |
127 | 137 |
128 int actualFrameCount = 0; | 138 int actualFrameCount = 0; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 187 |
178 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); | 188 FrameView* rootView = page().deprecatedLocalMainFrame()->view(); |
179 | 189 |
180 if (!rootView) | 190 if (!rootView) |
181 return; | 191 return; |
182 | 192 |
183 rootView->setNeedsLayout(); | 193 rootView->setNeedsLayout(); |
184 } | 194 } |
185 | 195 |
186 } // namespace blink | 196 } // namespace blink |
OLD | NEW |