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

Unified Diff: ash/common/wm/dock/docked_window_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/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/common/wm/dock/docked_window_layout_manager.cc b/ash/common/wm/dock/docked_window_layout_manager.cc
index 8a3150845463b1e27c8cbfa0d4e3b0913fa058d9..4c5f40df4240398c3dd02ce7b828b0e47e00ccf4 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.cc
+++ b/ash/common/wm/dock/docked_window_layout_manager.cc
@@ -27,6 +27,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
+#include "ui/gfx/animation/animation_change_type.h"
#include "ui/views/background.h"
namespace ash {
@@ -55,7 +56,7 @@ class DockedBackgroundWidget : public views::Widget,
background_animator_(SHELF_BACKGROUND_DEFAULT, nullptr),
opaque_background_(ui::LAYER_SOLID_COLOR),
visible_background_type_(manager_->shelf()->GetBackgroundType()),
- visible_background_change_type_(BACKGROUND_CHANGE_IMMEDIATE) {
+ visible_background_change_type_(gfx::AnimationChangeType::IMMEDIATE) {
manager_->shelf()->AddObserver(this);
InitWidget(manager_->dock_container());
@@ -82,15 +83,14 @@ class DockedBackgroundWidget : public views::Widget,
}
// ShelfBackgroundAnimatorObserver:
- void UpdateShelfOpaqueBackground(int alpha) override {
+ void UpdateShelfBackground(int alpha) override {
const float kMaxAlpha = 255.0f;
opaque_background_.SetOpacity(alpha / kMaxAlpha);
}
// WmShelfObserver:
- void OnBackgroundTypeChanged(
- ShelfBackgroundType background_type,
- BackgroundAnimatorChangeType change_type) override {
+ void OnBackgroundTypeChanged(ShelfBackgroundType background_type,
+ gfx::AnimationChangeType change_type) override {
// Sets the background type. Starts an animation to transition to
// |background_type| if the widget is visible. If the widget is not visible,
// the animation is postponed till the widget becomes visible.
@@ -131,9 +131,9 @@ class DockedBackgroundWidget : public views::Widget,
void UpdateBackground() {
ShelfBackgroundType background_type =
IsVisible() ? visible_background_type_ : SHELF_BACKGROUND_DEFAULT;
- BackgroundAnimatorChangeType change_type =
+ gfx::AnimationChangeType change_type =
IsVisible() ? visible_background_change_type_
- : BACKGROUND_CHANGE_IMMEDIATE;
+ : gfx::AnimationChangeType::IMMEDIATE;
background_animator_.PaintBackground(background_type, change_type);
SchedulePaintInRect(gfx::Rect(GetWindowBoundsInScreen().size()));
}
@@ -154,7 +154,7 @@ class DockedBackgroundWidget : public views::Widget,
ShelfBackgroundType visible_background_type_;
// Whether the widget should animate to |visible_background_type_|.
- BackgroundAnimatorChangeType visible_background_change_type_;
+ gfx::AnimationChangeType visible_background_change_type_;
DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget);
};

Powered by Google App Engine
This is Rietveld 408576698