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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 98373006: Animating docked background in sync with shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Animating docked background in sync with shelf (rebase) Created 7 years 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 | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_observer.h » ('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 566db942d273abe3b4fd4804bdc7a19885bc24bc..9fb6b88a65aeec9028bb190ba8d14c176cf05ca8 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -175,9 +175,8 @@ class ShelfLayoutManager::UpdateShelfObserver
}
virtual void OnImplicitAnimationsCompleted() OVERRIDE {
- if (shelf_) {
- shelf_->UpdateShelfBackground(BackgroundAnimator::CHANGE_ANIMATE);
- }
+ if (shelf_)
+ shelf_->UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
delete this;
}
@@ -366,7 +365,7 @@ void ShelfLayoutManager::UpdateAutoHideState() {
void ShelfLayoutManager::SetWindowOverlapsShelf(bool value) {
window_overlaps_shelf_ = value;
- UpdateShelfBackground(BackgroundAnimator::CHANGE_ANIMATE);
+ UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
}
void ShelfLayoutManager::AddObserver(ShelfLayoutManagerObserver* observer) {
@@ -385,7 +384,7 @@ void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) {
gesture_drag_amount_ = 0.f;
gesture_drag_auto_hide_state_ = visibility_state() == SHELF_AUTO_HIDE ?
auto_hide_state() : SHELF_AUTO_HIDE_SHOWN;
- UpdateShelfBackground(BackgroundAnimator::CHANGE_ANIMATE);
+ UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
}
ShelfLayoutManager::DragState ShelfLayoutManager::UpdateGestureDrag(
@@ -598,8 +597,7 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
State old_state = state_;
state_ = state;
- BackgroundAnimator::ChangeType change_type =
- BackgroundAnimator::CHANGE_ANIMATE;
+ BackgroundAnimatorChangeType change_type = BACKGROUND_CHANGE_ANIMATE;
bool delay_background_change = false;
// Do not animate the background when:
@@ -610,7 +608,7 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
if (state.visibility_state == SHELF_VISIBLE &&
state.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED &&
old_state.visibility_state != SHELF_VISIBLE) {
- change_type = BackgroundAnimator::CHANGE_IMMEDIATE;
+ change_type = BACKGROUND_CHANGE_IMMEDIATE;
} else {
// Delay the animation when the shelf was hidden, and has just been made
// visible (e.g. using a gesture-drag).
@@ -930,8 +928,11 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
}
void ShelfLayoutManager::UpdateShelfBackground(
- BackgroundAnimator::ChangeType type) {
- shelf_->SetPaintsBackground(GetShelfBackgroundType(), type);
+ BackgroundAnimatorChangeType type) {
+ const ShelfBackgroundType background_type(GetShelfBackgroundType());
+ shelf_->SetPaintsBackground(background_type, type);
+ FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
+ OnBackgroundUpdated(background_type, type));
}
ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
@@ -1134,6 +1135,7 @@ void ShelfLayoutManager::OnDockBoundsChanging(
if (dock_bounds_ != dock_bounds) {
dock_bounds_ = dock_bounds;
OnWindowResized();
+ UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
}
}
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698