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

Side by Side Diff: cc/animation/scrollbar_animation_controller_linear_fade.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to r248052. Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc » ('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/animation/scrollbar_animation_controller_linear_fade.h" 5 #include "cc/animation/scrollbar_animation_controller_linear_fade.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/layers/scrollbar_layer_impl_base.h" 9 #include "cc/layers/scrollbar_layer_impl_base.h"
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return 1.0f; 105 return 1.0f;
106 if (delta < fadeout_delay_ + fadeout_length_) { 106 if (delta < fadeout_delay_ + fadeout_length_) {
107 return (fadeout_delay_ + fadeout_length_ - delta).InSecondsF() / 107 return (fadeout_delay_ + fadeout_length_ - delta).InSecondsF() /
108 fadeout_length_.InSecondsF(); 108 fadeout_length_.InSecondsF();
109 } 109 }
110 return 0.0f; 110 return 0.0f;
111 } 111 }
112 112
113 void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars( 113 void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars(
114 float opacity) { 114 float opacity) {
115 ScrollbarLayerImplBase* horizontal_scrollbar = 115 if (!scroll_layer_->scrollbars())
116 scroll_layer_->horizontal_scrollbar_layer(); 116 return;
117 if (horizontal_scrollbar)
118 horizontal_scrollbar->SetOpacity(opacity);
119 117
120 ScrollbarLayerImplBase* vertical_scrollbar = 118 LayerImpl::ScrollbarSet* scrollbars = scroll_layer_->scrollbars();
121 scroll_layer_->vertical_scrollbar_layer(); 119 for (LayerImpl::ScrollbarSet::iterator it = scrollbars->begin();
122 if (vertical_scrollbar) 120 it != scrollbars->end();
123 vertical_scrollbar->SetOpacity(opacity); 121 ++it) {
122 ScrollbarLayerImplBase* scrollbar = *it;
123 if (scrollbar->is_overlay_scrollbar())
124 scrollbar->SetOpacity(opacity);
125 }
124 } 126 }
125 127
126 } // namespace cc 128 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698