Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameHost.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
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/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/frame/VisualViewport.h"
35 #include "core/inspector/ConsoleMessageStorage.h" 34 #include "core/inspector/ConsoleMessageStorage.h"
36 #include "core/page/Page.h" 35 #include "core/page/Page.h"
37 #include "core/page/scrolling/OverscrollController.h" 36 #include "core/page/scrolling/OverscrollController.h"
38 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 37 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
39 #include "public/platform/Platform.h" 38 #include "public/platform/Platform.h"
40 #include "public/platform/WebScheduler.h" 39 #include "public/platform/WebScheduler.h"
41 40
42 namespace blink { 41 namespace blink {
43 42
44 FrameHost* FrameHost::create(Page& page) { 43 FrameHost* FrameHost::create(Page& page) {
45 return new FrameHost(page); 44 return new FrameHost(page);
46 } 45 }
47 46
48 FrameHost::FrameHost(Page& page) 47 FrameHost::FrameHost(Page& page)
49 : m_page(&page), 48 : m_page(&page),
50 m_visualViewport(VisualViewport::create(page)),
51 m_overscrollController( 49 m_overscrollController(
52 OverscrollController::create(*m_visualViewport, 50 OverscrollController::create(m_page->visualViewport(),
53 m_page->chromeClient())), 51 m_page->chromeClient())),
54 m_consoleMessageStorage(new ConsoleMessageStorage()), 52 m_consoleMessageStorage(new ConsoleMessageStorage()),
55 m_globalRootScrollerController( 53 m_globalRootScrollerController(
56 TopDocumentRootScrollerController::create(page)), 54 TopDocumentRootScrollerController::create(page)),
57 m_subframeCount(0) {} 55 m_subframeCount(0) {}
58 56
59 // Explicitly in the .cpp to avoid default constructor in .h 57 // Explicitly in the .cpp to avoid default constructor in .h
60 FrameHost::~FrameHost() {} 58 FrameHost::~FrameHost() {}
61 59
62 Page& FrameHost::page() { 60 Page& FrameHost::page() {
(...skipping 13 matching lines...) Expand all
76 } 74 }
77 75
78 OverscrollController& FrameHost::overscrollController() { 76 OverscrollController& FrameHost::overscrollController() {
79 return *m_overscrollController; 77 return *m_overscrollController;
80 } 78 }
81 79
82 const OverscrollController& FrameHost::overscrollController() const { 80 const OverscrollController& FrameHost::overscrollController() const {
83 return *m_overscrollController; 81 return *m_overscrollController;
84 } 82 }
85 83
86 VisualViewport& FrameHost::visualViewport() {
87 return *m_visualViewport;
88 }
89
90 const VisualViewport& FrameHost::visualViewport() const {
91 return *m_visualViewport;
92 }
93
94 ConsoleMessageStorage& FrameHost::consoleMessageStorage() { 84 ConsoleMessageStorage& FrameHost::consoleMessageStorage() {
95 return *m_consoleMessageStorage; 85 return *m_consoleMessageStorage;
96 } 86 }
97 87
98 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const { 88 const ConsoleMessageStorage& FrameHost::consoleMessageStorage() const {
99 return *m_consoleMessageStorage; 89 return *m_consoleMessageStorage;
100 } 90 }
101 91
102 TopDocumentRootScrollerController& FrameHost::globalRootScrollerController() 92 TopDocumentRootScrollerController& FrameHost::globalRootScrollerController()
103 const { 93 const {
104 return *m_globalRootScrollerController; 94 return *m_globalRootScrollerController;
105 } 95 }
106 96
107 DEFINE_TRACE(FrameHost) { 97 DEFINE_TRACE(FrameHost) {
108 visitor->trace(m_page); 98 visitor->trace(m_page);
109 visitor->trace(m_visualViewport);
110 visitor->trace(m_overscrollController); 99 visitor->trace(m_overscrollController);
111 visitor->trace(m_consoleMessageStorage); 100 visitor->trace(m_consoleMessageStorage);
112 visitor->trace(m_globalRootScrollerController); 101 visitor->trace(m_globalRootScrollerController);
113 } 102 }
114 103
115 #if DCHECK_IS_ON() 104 #if DCHECK_IS_ON()
116 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { 105 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
117 ASSERT(expectedFrameCount >= 0); 106 ASSERT(expectedFrameCount >= 0);
118 107
119 int actualFrameCount = 0; 108 int actualFrameCount = 0;
120 for (; frame; frame = frame->tree().traverseNext()) 109 for (; frame; frame = frame->tree().traverseNext())
121 ++actualFrameCount; 110 ++actualFrameCount;
122 111
123 ASSERT(expectedFrameCount == actualFrameCount); 112 ASSERT(expectedFrameCount == actualFrameCount);
124 } 113 }
125 #endif 114 #endif
126 115
127 int FrameHost::subframeCount() const { 116 int FrameHost::subframeCount() const {
128 #if DCHECK_IS_ON() 117 #if DCHECK_IS_ON()
129 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame()); 118 checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame());
130 #endif 119 #endif
131 return m_subframeCount; 120 return m_subframeCount;
132 } 121 }
133 122
134 } // namespace blink 123 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameHost.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698