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

Side by Side Diff: ui/views/controls/scrollbar/overlay_scroll_bar.cc

Issue 2816923002: change overlay scrollbar hover show to hover fade in (Closed)
Patch Set: combine fade_in_delay and fade_out_delay to fade_delay Created 3 years, 8 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 | « ui/native_theme/overlay_scrollbar_constants_aura.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/views/controls/scrollbar/overlay_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "cc/paint/paint_flags.h" 8 #include "cc/paint/paint_flags.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/compositor/scoped_layer_animation_settings.h" 10 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 StartHideCountdown(); 171 StartHideCountdown();
172 } 172 }
173 173
174 void OverlayScrollBar::Show() { 174 void OverlayScrollBar::Show() {
175 layer()->SetOpacity(1.0f); 175 layer()->SetOpacity(1.0f);
176 hide_timer_.Stop(); 176 hide_timer_.Stop();
177 } 177 }
178 178
179 void OverlayScrollBar::Hide() { 179 void OverlayScrollBar::Hide() {
180 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator()); 180 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator());
181 settings.SetTransitionDuration(ui::kOverlayScrollbarFadeOutDuration); 181 settings.SetTransitionDuration(ui::kOverlayScrollbarFadeDuration);
182 layer()->SetOpacity(0.0f); 182 layer()->SetOpacity(0.0f);
183 } 183 }
184 184
185 void OverlayScrollBar::StartHideCountdown() { 185 void OverlayScrollBar::StartHideCountdown() {
186 if (IsMouseHovered()) 186 if (IsMouseHovered())
187 return; 187 return;
188 hide_timer_.Start( 188 hide_timer_.Start(
189 FROM_HERE, ui::kOverlayScrollbarFadeOutDelay, 189 FROM_HERE, ui::kOverlayScrollbarFadeDelay,
190 base::Bind(&OverlayScrollBar::Hide, base::Unretained(this))); 190 base::Bind(&OverlayScrollBar::Hide, base::Unretained(this)));
191 } 191 }
192 192
193 } // namespace views 193 } // namespace views
OLDNEW
« no previous file with comments | « ui/native_theme/overlay_scrollbar_constants_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698