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

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 comments from patch set 4. 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
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/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/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..e307af958438b4d985ea1946e3dde512ab32f4e8 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -8,6 +8,7 @@
#include <cmath>
#include <vector>
+#include "ash/animation/animation_change_type.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/session/session_controller.h"
#include "ash/common/session/session_state_delegate.h"
@@ -96,7 +97,7 @@ class ShelfLayoutManager::UpdateShelfObserver
void OnImplicitAnimationsCompleted() override {
if (shelf_)
- shelf_->MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ shelf_->MaybeUpdateShelfBackground(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(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;
+ AnimationChangeType change_type = 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 = AnimationChangeType::IMMEDIATE;
} else {
// Delay the animation when the shelf was hidden, and has just been made
// visible (e.g. using a gesture-drag).
@@ -814,8 +815,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
}
}
-void ShelfLayoutManager::MaybeUpdateShelfBackground(
- BackgroundAnimatorChangeType type) {
+void ShelfLayoutManager::MaybeUpdateShelfBackground(AnimationChangeType type) {
const ShelfBackgroundType new_background_type(GetShelfBackgroundType());
if (new_background_type == shelf_background_type_)
@@ -981,7 +981,7 @@ void ShelfLayoutManager::OnDockBoundsChanging(
dock_bounds_ = dock_bounds;
OnWindowResized();
UpdateVisibilityState();
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(AnimationChangeType::ANIMATE);
}
}
@@ -994,7 +994,7 @@ void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) {
} else {
state_.pre_lock_screen_animation_active = false;
}
- MaybeUpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
+ MaybeUpdateShelfBackground(AnimationChangeType::ANIMATE);
}
void ShelfLayoutManager::SessionStateChanged(
@@ -1004,7 +1004,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(AnimationChangeType::ANIMATE);
if (was_adding_user != state_.IsAddingSecondaryUser()) {
UpdateShelfVisibilityAfterLoginUIChange();
return;
@@ -1060,7 +1060,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(AnimationChangeType::ANIMATE);
}
void ShelfLayoutManager::UpdateGestureDrag(const ui::GestureEvent& gesture) {
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/shelf/shelf_layout_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698