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

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..3c15ea7fddf27187346cff3865e360f8278fcbf0 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -652,6 +652,11 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
ui::ImplicitAnimationObserver* observer) {
base::AutoReset<bool> auto_reset_updating_bounds(&updating_bounds_, true);
+ // Setting visibility after enabling animations cause the visibile property to
+ // animate. Enable visibility here so that opacity can animate.
+ if (target_bounds.status_opacity)
+ shelf_->status_area_widget()->Show();
flackr 2014/09/23 19:14:03 This doesn't cause the invalid window state (Visib
jonross 2014/09/23 20:50:06 This apparently does trigger an invalid state, how
jonross 2014/09/23 21:06:20 Moved it for correctness.
+
ui::ScopedLayerAnimationSettings shelf_animation_setter(
GetLayer(shelf_)->GetAnimator());
ui::ScopedLayerAnimationSettings status_animation_setter(
@@ -686,11 +691,9 @@ 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.
+ // 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)
- 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