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

Side by Side 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: Added top_controls_content_offset 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 const LayerSelectionBound& end); 284 const LayerSelectionBound& end);
285 285
286 // Compute the current selection handle location and visbility with respect to 286 // Compute the current selection handle location and visbility with respect to
287 // the viewport. 287 // the viewport.
288 void GetViewportSelection(ViewportSelectionBound* start, 288 void GetViewportSelection(ViewportSelectionBound* start,
289 ViewportSelectionBound* end); 289 ViewportSelectionBound* end);
290 290
291 void RegisterPictureLayerImpl(PictureLayerImpl* layer); 291 void RegisterPictureLayerImpl(PictureLayerImpl* layer);
292 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); 292 void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
293 293
294 void set_top_controls_layout_height(float height) {
295 top_controls_layout_height_ = height;
296 }
297 void set_top_controls_content_offset(float offset) {
298 top_controls_content_offset_ = offset;
299 }
300 void set_top_controls_delta(float delta) {
301 top_controls_delta_ = delta;
302 }
303 void set_sent_top_controls_delta(float sent_delta) {
304 sent_top_controls_delta_ = sent_delta;
305 }
306
307 float top_controls_layout_height() const {
308 return top_controls_layout_height_;
309 }
310 float top_controls_content_offset() const {
311 return top_controls_content_offset_;
312 }
313 float top_controls_delta() const {
314 return top_controls_delta_;
315 }
316 float sent_top_controls_delta() const {
317 return sent_top_controls_delta_;
318 }
319 float total_top_controls_content_offset() const {
320 return top_controls_content_offset_ + top_controls_delta_;
321 }
322
294 protected: 323 protected:
295 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); 324 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl);
296 void ReleaseResourcesRecursive(LayerImpl* current); 325 void ReleaseResourcesRecursive(LayerImpl* current);
297 326
298 LayerTreeHostImpl* layer_tree_host_impl_; 327 LayerTreeHostImpl* layer_tree_host_impl_;
299 int source_frame_number_; 328 int source_frame_number_;
300 scoped_ptr<LayerImpl> root_layer_; 329 scoped_ptr<LayerImpl> root_layer_;
301 HeadsUpDisplayLayerImpl* hud_layer_; 330 HeadsUpDisplayLayerImpl* hud_layer_;
302 LayerImpl* currently_scrolling_layer_; 331 LayerImpl* currently_scrolling_layer_;
303 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; 332 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 bool next_activation_forces_redraw_; 373 bool next_activation_forces_redraw_;
345 374
346 bool has_ever_been_drawn_; 375 bool has_ever_been_drawn_;
347 376
348 ScopedPtrVector<SwapPromise> swap_promise_list_; 377 ScopedPtrVector<SwapPromise> swap_promise_list_;
349 378
350 UIResourceRequestQueue ui_resource_request_queue_; 379 UIResourceRequestQueue ui_resource_request_queue_;
351 380
352 int render_surface_layer_list_id_; 381 int render_surface_layer_list_id_;
353 382
383 // The top controls content offset at the time of the last layout (and thus,
384 // viewport resize) in Blink. i.e. How much the viewport was shrunk by the top
385 // controls.
386 float top_controls_layout_height_;
387
388 // The up-to-date content offset of the top controls, i.e. the amount that the
389 // web contents have been shifted down from the top of the device viewport.
390 float top_controls_content_offset_;
391 float top_controls_delta_;
392 float sent_top_controls_delta_;
393
354 private: 394 private:
355 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 395 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
356 }; 396 };
357 397
358 } // namespace cc 398 } // namespace cc
359 399
360 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 400 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698