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

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 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/wm/background_animator.cc ('k') | ui/gfx/animation/slide_animation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e8419aa13cf2731b1e706b854ac28868d8ce39f4 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.cc
+++ b/ash/common/wm/dock/docked_window_layout_manager.cc
@@ -4,6 +4,7 @@
#include "ash/common/wm/dock/docked_window_layout_manager.h"
+#include "ash/animation/animation_change_type.h"
#include "ash/common/shelf/shelf_background_animator.h"
#include "ash/common/shelf/shelf_background_animator_observer.h"
#include "ash/common/shelf/shelf_constants.h"
@@ -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_(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,
+ 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 =
- IsVisible() ? visible_background_change_type_
- : BACKGROUND_CHANGE_IMMEDIATE;
+ AnimationChangeType change_type = IsVisible()
+ ? visible_background_change_type_
+ : 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_;
+ AnimationChangeType visible_background_change_type_;
DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget);
};
« no previous file with comments | « ash/common/wm/background_animator.cc ('k') | ui/gfx/animation/slide_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698