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

Unified Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2679333002: [ash-md] Remove the number of animators used for the Shelf animations. (Closed)
Patch Set: Addressed review comments and updated ShelfBackgroundAnimator::animator_ lifetime. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/shelf/shelf_layout_manager.cc
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index a860a9b07a89cfe94134ed5f9772c838d9a9ab50..4c866377da0b6e7f88122ad8764f7909dab4243a 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -37,6 +37,7 @@
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/events/event_handler.h"
+#include "ui/gfx/animation/animation_change_type.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
#include "ui/views/border.h"
@@ -96,7 +97,7 @@ class ShelfLayoutManager::UpdateShelfObserver
void OnImplicitAnimationsCompleted() override {
if (shelf_)
- shelf_->MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ shelf_->MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
delete this;
}
@@ -325,7 +326,7 @@ void ShelfLayoutManager::UpdateAutoHideForGestureEvent(ui::GestureEvent* event,
void ShelfLayoutManager::SetWindowOverlapsShelf(bool value) {
window_overlaps_shelf_ = value;
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
}
void ShelfLayoutManager::AddObserver(ShelfLayoutManagerObserver* observer) {
@@ -500,7 +501,7 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
State old_state = state_;
state_ = state;
- BackgroundAnimatorChangeType change_type = BACKGROUND_CHANGE_ANIMATE;
+ gfx::AnimationChangeType change_type = gfx::AnimationChangeType::ANIMATE;
bool delay_background_change = false;
// Do not animate the background when:
@@ -511,7 +512,7 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
if (state.visibility_state == SHELF_VISIBLE &&
state.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED &&
old_state.visibility_state != SHELF_VISIBLE) {
- change_type = BACKGROUND_CHANGE_IMMEDIATE;
+ change_type = gfx::AnimationChangeType::IMMEDIATE;
} else {
// Delay the animation when the shelf was hidden, and has just been made
// visible (e.g. using a gesture-drag).
@@ -815,7 +816,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
}
void ShelfLayoutManager::MaybeUpdateShelfBackground(
- BackgroundAnimatorChangeType type) {
+ gfx::AnimationChangeType type) {
const ShelfBackgroundType new_background_type(GetShelfBackgroundType());
if (new_background_type == shelf_background_type_)
@@ -981,7 +982,7 @@ void ShelfLayoutManager::OnDockBoundsChanging(
dock_bounds_ = dock_bounds;
OnWindowResized();
UpdateVisibilityState();
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
}
}
@@ -994,7 +995,7 @@ void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) {
} else {
state_.pre_lock_screen_animation_active = false;
}
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
}
void ShelfLayoutManager::SessionStateChanged(
@@ -1004,7 +1005,7 @@ void ShelfLayoutManager::SessionStateChanged(
const bool was_adding_user = state_.IsAddingSecondaryUser();
const bool was_locked = state_.IsScreenLocked();
state_.session_state = state;
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
if (was_adding_user != state_.IsAddingSecondaryUser()) {
UpdateShelfVisibilityAfterLoginUIChange();
return;
@@ -1060,7 +1061,7 @@ void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) {
gesture_drag_auto_hide_state_ = visibility_state() == SHELF_AUTO_HIDE
? auto_hide_state()
: SHELF_AUTO_HIDE_SHOWN;
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(gfx::AnimationChangeType::ANIMATE);
}
void ShelfLayoutManager::UpdateGestureDrag(const ui::GestureEvent& gesture) {

Powered by Google App Engine
This is Rietveld 408576698