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

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

Issue 2622103002: Generalize browser controls adjustment for arbitrary scrollers. (Closed)
Patch Set: Fixed some comments Created 3 years, 11 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); 139 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale);
140 140
141 // FIXME: This is kind of a hack. Ideally, we would just resize the 141 // FIXME: This is kind of a hack. Ideally, we would just resize the
142 // viewports to account for browser controls. However, FrameView includes much 142 // viewports to account for browser controls. However, FrameView includes much
143 // more than just scrolling so we can't simply resize it without incurring 143 // more than just scrolling so we can't simply resize it without incurring
144 // all sorts of side-effects. Until we can seperate out the scrollability 144 // all sorts of side-effects. Until we can seperate out the scrollability
145 // aspect from FrameView, we use this method to let VisualViewport make the 145 // aspect from FrameView, we use this method to let VisualViewport make the
146 // necessary adjustments so that we don't incorrectly clamp scroll offsets 146 // necessary adjustments so that we don't incorrectly clamp scroll offsets
147 // coming from the compositor. crbug.com/422328 147 // coming from the compositor. crbug.com/422328
148 void setBrowserControlsAdjustment(float); 148 void setBrowserControlsAdjustment(float);
149 float browserControlsAdjustment() const;
149 150
150 // Adjust the viewport's offset so that it remains bounded by the outer 151 // Adjust the viewport's offset so that it remains bounded by the outer
151 // viepwort. 152 // viepwort.
152 void clampToBoundaries(); 153 void clampToBoundaries();
153 154
154 FloatRect viewportToRootFrame(const FloatRect&) const; 155 FloatRect viewportToRootFrame(const FloatRect&) const;
155 IntRect viewportToRootFrame(const IntRect&) const; 156 IntRect viewportToRootFrame(const IntRect&) const;
156 FloatRect rootFrameToViewport(const FloatRect&) const; 157 FloatRect rootFrameToViewport(const FloatRect&) const;
157 IntRect rootFrameToViewport(const IntRect&) const; 158 IntRect rootFrameToViewport(const IntRect&) const;
158 159
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 float m_scale; 268 float m_scale;
268 IntSize m_size; 269 IntSize m_size;
269 float m_browserControlsAdjustment; 270 float m_browserControlsAdjustment;
270 float m_maxPageScale; 271 float m_maxPageScale;
271 bool m_trackPinchZoomStatsForPage; 272 bool m_trackPinchZoomStatsForPage;
272 }; 273 };
273 274
274 } // namespace blink 275 } // namespace blink
275 276
276 #endif // VisualViewport_h 277 #endif // VisualViewport_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/frame/VisualViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698