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