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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 655783004: Hide scrollbars when their dimensions are not scrollable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed can_scroll_orientation() -> CanScrollOrientation() Created 6 years, 2 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/scrollbar_layer_impl_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ScrollDelta() + scroll - new_delta; 383 ScrollDelta() + scroll - new_delta;
384 SetScrollDelta(new_delta); 384 SetScrollDelta(new_delta);
385 385
386 return unscrolled; 386 return unscrolled;
387 } 387 }
388 388
389 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { 389 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) {
390 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); 390 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id);
391 } 391 }
392 392
393 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const {
394 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_
395 : user_scrollable_vertical_;
396 }
397
393 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { 398 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() {
394 // Pending tree never has sent scroll deltas 399 // Pending tree never has sent scroll deltas
395 DCHECK(layer_tree_impl()->IsActiveTree()); 400 DCHECK(layer_tree_impl()->IsActiveTree());
396 401
397 // Apply sent scroll deltas to scroll position / scroll delta as if the 402 // Apply sent scroll deltas to scroll position / scroll delta as if the
398 // main thread had applied them and then committed those values. 403 // main thread had applied them and then committed those values.
399 // 404 //
400 // This function should not change the total scroll offset; it just shifts 405 // This function should not change the total scroll offset; it just shifts
401 // some of the scroll delta to the scroll offset. Therefore, adjust these 406 // some of the scroll delta to the scroll offset. Therefore, adjust these
402 // variables directly rather than calling the scroll offset delegate to 407 // variables directly rather than calling the scroll offset delegate to
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 } 1578 }
1574 1579
1575 void LayerImpl::NotifyAnimationFinished( 1580 void LayerImpl::NotifyAnimationFinished(
1576 base::TimeTicks monotonic_time, 1581 base::TimeTicks monotonic_time,
1577 Animation::TargetProperty target_property) { 1582 Animation::TargetProperty target_property) {
1578 if (target_property == Animation::ScrollOffset) 1583 if (target_property == Animation::ScrollOffset)
1579 layer_tree_impl_->InputScrollAnimationFinished(); 1584 layer_tree_impl_->InputScrollAnimationFinished();
1580 } 1585 }
1581 1586
1582 } // namespace cc 1587 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/scrollbar_layer_impl_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698