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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Emulator using GC, moved to FrameHost, addressed other comments. Created 4 years, 5 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 25 matching lines...) Expand all
36 #include "wtf/Allocator.h" 36 #include "wtf/Allocator.h"
37 #include "wtf/Noncopyable.h" 37 #include "wtf/Noncopyable.h"
38 #include "wtf/text/AtomicString.h" 38 #include "wtf/text/AtomicString.h"
39 #include <memory> 39 #include <memory>
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class ChromeClient; 43 class ChromeClient;
44 class CustomElementReactionStack; 44 class CustomElementReactionStack;
45 class Deprecation; 45 class Deprecation;
46 class DoublePoint;
46 class EventHandlerRegistry; 47 class EventHandlerRegistry;
48 class IntPoint;
47 class OverscrollController; 49 class OverscrollController;
48 class Page; 50 class Page;
49 struct PageScaleConstraints; 51 struct PageScaleConstraints;
50 class PageScaleConstraintsSet; 52 class PageScaleConstraintsSet;
53 class ScrollAndScaleEmulator;
51 class Settings; 54 class Settings;
52 class TopControls; 55 class TopControls;
53 class UseCounter; 56 class UseCounter;
54 class Visitor; 57 class Visitor;
55 class VisualViewport; 58 class VisualViewport;
56 59
57 // FrameHost is the set of global data shared between multiple frames 60 // FrameHost is the set of global data shared between multiple frames
58 // and is provided by the embedder to each frame when created. 61 // and is provided by the embedder to each frame when created.
59 // FrameHost currently corresponds to the Page object in core/page 62 // FrameHost currently corresponds to the Page object in core/page
60 // however the concept of a Page is moving up out of Blink. 63 // however the concept of a Page is moving up out of Blink.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // recursive frameset pages can quickly bring the program to its knees 126 // recursive frameset pages can quickly bring the program to its knees
124 // with exponential growth in the number of frames. 127 // with exponential growth in the number of frames.
125 static const int maxNumberOfFrames = 1000; 128 static const int maxNumberOfFrames = 1000;
126 void incrementSubframeCount() { ++m_subframeCount; } 129 void incrementSubframeCount() { ++m_subframeCount; }
127 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; } 130 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
128 int subframeCount() const; 131 int subframeCount() const;
129 132
130 void setDefaultPageScaleLimits(float minScale, float maxScale); 133 void setDefaultPageScaleLimits(float minScale, float maxScale);
131 void setUserAgentPageScaleConstraints(const PageScaleConstraints& newConstra ints); 134 void setUserAgentPageScaleConstraints(const PageScaleConstraints& newConstra ints);
132 135
136 // Override the page scale and scroll positions of main frame and visual vie wport.
137 void setScrollAndScaleOverride(const IntPoint& framePosition, const DoublePo int& visualViewportPosition, float pageScale);
138 void clearScrollAndScaleOverride();
139 ScrollAndScaleEmulator* scrollAndScaleEmulator() { return m_scrollAndScaleEm ulator; }
140
133 private: 141 private:
134 explicit FrameHost(Page&); 142 explicit FrameHost(Page&);
135 143
136 const Member<Page> m_page; 144 const Member<Page> m_page;
137 const Member<TopControls> m_topControls; 145 const Member<TopControls> m_topControls;
138 const std::unique_ptr<PageScaleConstraintsSet> m_pageScaleConstraintsSet; 146 const std::unique_ptr<PageScaleConstraintsSet> m_pageScaleConstraintsSet;
139 const Member<VisualViewport> m_visualViewport; 147 const Member<VisualViewport> m_visualViewport;
140 const Member<OverscrollController> m_overscrollController; 148 const Member<OverscrollController> m_overscrollController;
141 const Member<EventHandlerRegistry> m_eventHandlerRegistry; 149 const Member<EventHandlerRegistry> m_eventHandlerRegistry;
142 const Member<CustomElementReactionStack> m_customElementReactionStack; 150 const Member<CustomElementReactionStack> m_customElementReactionStack;
151 Member<ScrollAndScaleEmulator> m_scrollAndScaleEmulator;
143 152
144 AtomicString m_overrideEncoding; 153 AtomicString m_overrideEncoding;
145 int m_subframeCount; 154 int m_subframeCount;
146 }; 155 };
147 156
148 } // namespace blink 157 } // namespace blink
149 158
150 #endif // FrameHost_h 159 #endif // FrameHost_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698