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

Unified Diff: cc/trees/layer_tree_impl.h

Issue 511253003: Made Blink aware of top controls offset (Chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash + mojo example build break Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index c7b4acf2497bdf0fcfe16009fda635d959145e97..efe778f6830f5b8b69145fbf4f0d4e3fb1b5e525 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -292,6 +292,35 @@ class CC_EXPORT LayerTreeImpl {
void RegisterPictureLayerImpl(PictureLayerImpl* layer);
void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
+ void set_top_controls_layout_height(float height) {
+ top_controls_layout_height_ = height;
+ }
+ void set_top_controls_top_offset(float offset) {
+ top_controls_top_offset_ = offset;
+ }
+ void set_top_controls_delta(float delta) {
+ top_controls_delta_ = delta;
+ }
+ void set_sent_top_controls_delta(float sent_delta) {
+ sent_top_controls_delta_ = sent_delta;
+ }
+
+ float top_controls_layout_height() const {
+ return top_controls_layout_height_;
+ }
+ float top_controls_top_offset() const {
+ return top_controls_top_offset_;
+ }
+ float top_controls_delta() const {
+ return top_controls_delta_;
+ }
+ float sent_top_controls_delta() const {
+ return sent_top_controls_delta_;
+ }
+ float total_top_controls_top_offset() const {
+ return top_controls_top_offset_ + top_controls_delta_;
+ }
+
protected:
explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl);
void ReleaseResourcesRecursive(LayerImpl* current);
@@ -352,6 +381,17 @@ class CC_EXPORT LayerTreeImpl {
int render_surface_layer_list_id_;
+ // The top controls content offset at the time of the last layout (and thus,
+ // viewport resize) in Blink. i.e. How much the viewport was shrunk by the top
+ // controls.
+ float top_controls_layout_height_;
+
+ // The up-to-date content offset of the top controls, i.e. the amount that the
+ // web contents have been shifted down from the top of the device viewport.
+ float top_controls_top_offset_;
+ float top_controls_delta_;
+ float sent_top_controls_delta_;
+
private:
DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
};
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698