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

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

Issue 640063002: Hide scrollbars when their dimensions are not scrollable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Hide scrollbar by setting opacity to 0 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
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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 ScrollDelta() + scroll - new_delta; 376 ScrollDelta() + scroll - new_delta;
377 SetScrollDelta(new_delta); 377 SetScrollDelta(new_delta);
378 378
379 return unscrolled; 379 return unscrolled;
380 } 380 }
381 381
382 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { 382 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) {
383 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); 383 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id);
384 } 384 }
385 385
386 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const {
387 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_
388 : user_scrollable_vertical_;
389 }
390
386 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { 391 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() {
387 // Pending tree never has sent scroll deltas 392 // Pending tree never has sent scroll deltas
388 DCHECK(layer_tree_impl()->IsActiveTree()); 393 DCHECK(layer_tree_impl()->IsActiveTree());
389 394
390 // Apply sent scroll deltas to scroll position / scroll delta as if the 395 // Apply sent scroll deltas to scroll position / scroll delta as if the
391 // main thread had applied them and then committed those values. 396 // main thread had applied them and then committed those values.
392 // 397 //
393 // This function should not change the total scroll offset; it just shifts 398 // This function should not change the total scroll offset; it just shifts
394 // some of the scroll delta to the scroll offset. Therefore, adjust these 399 // some of the scroll delta to the scroll offset. Therefore, adjust these
395 // variables directly rather than calling the scroll offset delegate to 400 // variables directly rather than calling the scroll offset delegate to
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 } 1561 }
1557 1562
1558 void LayerImpl::NotifyAnimationFinished( 1563 void LayerImpl::NotifyAnimationFinished(
1559 base::TimeTicks monotonic_time, 1564 base::TimeTicks monotonic_time,
1560 Animation::TargetProperty target_property) { 1565 Animation::TargetProperty target_property) {
1561 if (target_property == Animation::ScrollOffset) 1566 if (target_property == Animation::ScrollOffset)
1562 layer_tree_impl_->InputScrollAnimationFinished(); 1567 layer_tree_impl_->InputScrollAnimationFinished();
1563 } 1568 }
1564 1569
1565 } // namespace cc 1570 } // namespace cc
OLDNEW
« cc/animation/scrollbar_animation_controller_linear_fade.cc ('K') | « cc/layers/layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698