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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 596863003: Status Trays delayed visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 0d6713b15feb21df009f6147a2b125bd33b6e8ab..dbdad122f6d8cb17ca01ebc68985e5dd6fc53a72 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -686,11 +686,18 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
target_bounds.status_opacity);
// Having a window which is visible but does not have an opacity is an illegal
- // state. We therefore show / hide the shelf here if required.
- if (!target_bounds.status_opacity)
+ // state. We therefore hide the shelf here if required.
+ if (!target_bounds.status_opacity) {
shelf_->status_area_widget()->Hide();
- else if (target_bounds.status_opacity)
+ } else {
+ // Setting visibility during an animation causes the visibility property to
+ // animate. Override the animation settings to immediately set the
flackr 2014/09/23 21:18:40 I'd prefer to see the scope of the ScopedLayerAnim
jonross 2014/09/23 21:34:26 Done.
+ // visibility property. Opacity will still animate.
+ ui::ScopedLayerAnimationSettings no_duration_show(
+ GetLayer(shelf_->status_area_widget())->GetAnimator());
+ no_duration_show.SetTransitionDuration(base::TimeDelta());
shelf_->status_area_widget()->Show();
+ }
// TODO(harrym): Once status area widget is a child view of shelf
// this can be simplified.
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698