diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-15 17:29:30 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-15 17:29:30 +0000 |
commit | ffb15d1eb8fc4180b30b43865fc44427f29cd578 (patch) | |
tree | ea89569dc78f3a5a103dfb7eef8a4b5bc8879268 /ash | |
parent | 70cdf8d473698e4f9203dde64bfa9147dc4d70e7 (diff) | |
download | chromium_src-ffb15d1eb8fc4180b30b43865fc44427f29cd578.zip chromium_src-ffb15d1eb8fc4180b30b43865fc44427f29cd578.tar.gz chromium_src-ffb15d1eb8fc4180b30b43865fc44427f29cd578.tar.bz2 |
ui/base/animation -> ui/gfx/animation
I also made GFX_EXPORT real, which is ok since it's the same as
UI_EXPORT. It'll only matter when we separate out at gyp level.
BUG=none
TEST=none
R=ben@chromium.org
Review URL: https://codereview.chromium.org/23531053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
39 files changed, 163 insertions, 168 deletions
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc index b46b6e3..fa13434 100644 --- a/ash/desktop_background/desktop_background_controller_unittest.cc +++ b/ash/desktop_background/desktop_background_controller_unittest.cc @@ -85,7 +85,7 @@ void RunAnimationForWidget(views::Widget* widget) { ui::Layer* layer = widget->GetNativeView()->layer(); ui::LayerAnimatorTestController controller(layer->GetAnimator()); - ui::AnimationContainerElement* element = layer->GetAnimator(); + gfx::AnimationContainerElement* element = layer->GetAnimator(); // Multiple steps are required to complete complex animations. // TODO(vollick): This should not be necessary. crbug.com/154017 while (controller.animator()->is_animating()) { diff --git a/ash/display/shared_display_edge_indicator.cc b/ash/display/shared_display_edge_indicator.cc index cfcf4ba..0e16cee 100644 --- a/ash/display/shared_display_edge_indicator.cc +++ b/ash/display/shared_display_edge_indicator.cc @@ -10,7 +10,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/root_window.h" -#include "ui/base/animation/throb_animation.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" @@ -88,7 +88,7 @@ void SharedDisplayEdgeIndicator::Show(const gfx::Rect& src_bounds, dst_indicator_ = new IndicatorView; CreateWidget(src_bounds, src_indicator_); CreateWidget(dst_bounds, dst_indicator_); - animation_.reset(new ui::ThrobAnimation(this)); + animation_.reset(new gfx::ThrobAnimation(this)); animation_->SetThrobDuration(kIndicatorAnimationDurationMs); animation_->StartThrobbing(-1 /* infinite */); } @@ -103,7 +103,7 @@ void SharedDisplayEdgeIndicator::Hide() { } void SharedDisplayEdgeIndicator::AnimationProgressed( - const ui::Animation* animation) { + const gfx::Animation* animation) { int value = animation->CurrentValueBetween(0, 255); SkColor color = SkColorSetARGB(0xFF, value, value, value); if (src_indicator_) diff --git a/ash/display/shared_display_edge_indicator.h b/ash/display/shared_display_edge_indicator.h index 762d067..d0d242d 100644 --- a/ash/display/shared_display_edge_indicator.h +++ b/ash/display/shared_display_edge_indicator.h @@ -8,14 +8,11 @@ #include "ash/ash_export.h" #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/display.h" namespace gfx { class Rect; -} - -namespace ui { class ThrobAnimation; } @@ -29,7 +26,7 @@ namespace internal { // SharedDisplayEdgeIndicator is responsible for showing a window that indicates // the edge that a window can be dragged into another display. -class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate { +class ASH_EXPORT SharedDisplayEdgeIndicator : public gfx::AnimationDelegate { public: SharedDisplayEdgeIndicator(); virtual ~SharedDisplayEdgeIndicator(); @@ -40,8 +37,8 @@ class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate { void Show(const gfx::Rect& src_bounds, const gfx::Rect& dst_bounds); void Hide(); - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: // Used to show the displays' shared edge where a window can be moved across. @@ -51,7 +48,7 @@ class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate { views::View* dst_indicator_; // Used to transition the opacity. - scoped_ptr<ui::ThrobAnimation> animation_; + scoped_ptr<gfx::ThrobAnimation> animation_; DISALLOW_COPY_AND_ASSIGN(SharedDisplayEdgeIndicator); }; diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index 8d587c4..c2df991 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -17,12 +17,12 @@ #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" -#include "ui/base/animation/linear_animation.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/events/event.h" #include "ui/base/events/event_utils.h" #include "ui/base/hit_test.h" +#include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/path.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -471,17 +471,17 @@ void DragDropController::OnWindowDestroyed(aura::Window* window) { //////////////////////////////////////////////////////////////////////////////// // DragDropController, protected: -ui::LinearAnimation* DragDropController::CreateCancelAnimation( +gfx::LinearAnimation* DragDropController::CreateCancelAnimation( int duration, int frame_rate, - ui::AnimationDelegate* delegate) { - return new ui::LinearAnimation(duration, frame_rate, delegate); + gfx::AnimationDelegate* delegate) { + return new gfx::LinearAnimation(duration, frame_rate, delegate); } //////////////////////////////////////////////////////////////////////////////// // DragDropController, private: -void DragDropController::AnimationEnded(const ui::Animation* animation) { +void DragDropController::AnimationEnded(const gfx::Animation* animation) { cancel_animation_.reset(); // By the time we finish animation, another drag/drop session may have @@ -520,14 +520,14 @@ void DragDropController::DoDragCancel(int drag_cancel_animation_duration_ms) { quit_closure_.Run(); } -void DragDropController::AnimationProgressed(const ui::Animation* animation) { +void DragDropController::AnimationProgressed(const gfx::Animation* animation) { gfx::Rect current_bounds = animation->CurrentValueBetween( drag_image_initial_bounds_for_cancel_animation_, drag_image_final_bounds_for_cancel_animation_); drag_image_->SetBoundsInScreen(current_bounds); } -void DragDropController::AnimationCanceled(const ui::Animation* animation) { +void DragDropController::AnimationCanceled(const gfx::Animation* animation) { AnimationEnded(animation); } diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h index a23ed91..ec5cac1 100644 --- a/ash/drag_drop/drag_drop_controller.h +++ b/ash/drag_drop/drag_drop_controller.h @@ -10,10 +10,10 @@ #include "base/memory/weak_ptr.h" #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/window_observer.h" -#include "ui/base/animation/animation_delegate.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/events/event_constants.h" #include "ui/base/events/event_handler.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/rect.h" namespace aura { @@ -21,7 +21,7 @@ class RootWindow; class Window; } -namespace ui { +namespace gfx { class LinearAnimation; } @@ -40,7 +40,7 @@ class DragImageView; class ASH_EXPORT DragDropController : public aura::client::DragDropClient, public ui::EventHandler, - public ui::AnimationDelegate, + public gfx::AnimationDelegate, public aura::WindowObserver { public: DragDropController(); @@ -78,10 +78,10 @@ class ASH_EXPORT DragDropController // Helper method to create a LinearAnimation object that will run the drag // cancel animation. Caller take ownership of the returned object. Protected // for testing. - virtual ui::LinearAnimation* CreateCancelAnimation( + virtual gfx::LinearAnimation* CreateCancelAnimation( int duration, int frame_rate, - ui::AnimationDelegate* delegate); + gfx::AnimationDelegate* delegate); // Actual implementation of |DragCancel()|. protected for testing. virtual void DoDragCancel(int drag_cancel_animation_duration_ms); @@ -89,10 +89,10 @@ class ASH_EXPORT DragDropController private: friend class ash::test::DragDropControllerTest; - // Overridden from ui::AnimationDelegate: - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; + // Overridden from gfx::AnimationDelegate: + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; // Helper method to start drag widget flying back animation. void StartCanceledAnimation(int animation_duration_ms); @@ -115,7 +115,7 @@ class ASH_EXPORT DragDropController gfx::Rect drag_image_initial_bounds_for_cancel_animation_; gfx::Rect drag_image_final_bounds_for_cancel_animation_; - scoped_ptr<ui::LinearAnimation> cancel_animation_; + scoped_ptr<gfx::LinearAnimation> cancel_animation_; // Window that started the drag. aura::Window* drag_source_window_; diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index 7ca79ea0..ce4e752 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -14,7 +14,6 @@ #include "ui/aura/client/capture_client.h" #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" -#include "ui/base/animation/linear_animation.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/base/dragdrop/drag_drop_types.h" @@ -24,6 +23,7 @@ #include "ui/base/events/event_utils.h" #include "ui/base/gestures/gesture_types.h" #include "ui/base/ui_base_switches.h" +#include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/image/image_skia_rep.h" #include "ui/views/test/test_views_delegate.h" #include "ui/views/view.h" @@ -130,12 +130,12 @@ class DragTestView : public views::View { DISALLOW_COPY_AND_ASSIGN(DragTestView); }; -class CompletableLinearAnimation : public ui::LinearAnimation { +class CompletableLinearAnimation : public gfx::LinearAnimation { public: CompletableLinearAnimation(int duration, int frame_rate, - ui::AnimationDelegate* delegate) - : ui::LinearAnimation(duration, frame_rate, delegate), + gfx::AnimationDelegate* delegate) + : gfx::LinearAnimation(duration, frame_rate, delegate), duration_(duration) { } @@ -191,10 +191,10 @@ class TestDragDropController : public internal::DragDropController { drag_canceled_ = true; } - virtual ui::LinearAnimation* CreateCancelAnimation( + virtual gfx::LinearAnimation* CreateCancelAnimation( int duration, int frame_rate, - ui::AnimationDelegate* delegate) OVERRIDE { + gfx::AnimationDelegate* delegate) OVERRIDE { return new CompletableLinearAnimation(duration, frame_rate, delegate); } diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc index 2ce96eb..6b9dedd 100644 --- a/ash/launcher/launcher_button.cc +++ b/ash/launcher/launcher_button.cc @@ -12,12 +12,12 @@ #include "grit/ash_resources.h" #include "skia/ext/image_operations.h" #include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/events/event_constants.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia_operations.h" @@ -46,7 +46,7 @@ bool ShouldHop(int state) { // Simple AnimationDelegate that owns a single ThrobAnimation instance to // keep all Draw Attention animations in sync. -class LauncherButtonAnimation : public ui::AnimationDelegate { +class LauncherButtonAnimation : public gfx::AnimationDelegate { public: class Observer { public: @@ -83,13 +83,13 @@ class LauncherButtonAnimation : public ui::AnimationDelegate { LauncherButtonAnimation() : animation_(this) { animation_.SetThrobDuration(kAttentionThrobDurationMS); - animation_.SetTweenType(ui::Tween::SMOOTH_IN_OUT); + animation_.SetTweenType(gfx::Tween::SMOOTH_IN_OUT); } virtual ~LauncherButtonAnimation() { } - ui::ThrobAnimation& GetThrobAnimation() { + gfx::ThrobAnimation& GetThrobAnimation() { if (!animation_.is_animating()) { animation_.Reset(); animation_.StartThrobbing(-1 /*throb indefinitely*/); @@ -97,8 +97,8 @@ class LauncherButtonAnimation : public ui::AnimationDelegate { return animation_; } - // ui::AnimationDelegate - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { + // gfx::AnimationDelegate + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE { if (animation != &animation_) return; if (!animation_.is_animating()) @@ -106,7 +106,7 @@ class LauncherButtonAnimation : public ui::AnimationDelegate { FOR_EACH_OBSERVER(Observer, observers_, AnimationProgressed()); } - ui::ThrobAnimation animation_; + gfx::ThrobAnimation animation_; ObserverList<Observer> observers_; DISALLOW_COPY_AND_ASSIGN(LauncherButtonAnimation); @@ -319,7 +319,7 @@ void LauncherButton::ClearState(State state) { (!ShouldHop(state) || ShouldHop(state_))) { ui::ScopedLayerAnimationSettings scoped_setter( icon_view_->layer()->GetAnimator()); - scoped_setter.SetTweenType(ui::Tween::LINEAR); + scoped_setter.SetTweenType(gfx::Tween::LINEAR); scoped_setter.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kHopDownMS)); } diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index 57bcf26..d390d14 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -52,7 +52,7 @@ #include "ui/views/view_model_utils.h" #include "ui/views/widget/widget.h" -using ui::Animation; +using gfx::Animation; using views::View; namespace ash { diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index e796d182..02a2a8b 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -265,7 +265,7 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip, settings.AddObserver(this); settings.SetPreemptionStrategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); settings.SetTransitionDuration( base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); diff --git a/ash/shelf/background_animator.cc b/ash/shelf/background_animator.cc index dedae6f..35e5fba 100644 --- a/ash/shelf/background_animator.cc +++ b/ash/shelf/background_animator.cc @@ -49,7 +49,7 @@ void BackgroundAnimator::SetPaintsBackground(bool value, ChangeType type) { animation_.Hide(); } -void BackgroundAnimator::AnimationProgressed(const ui::Animation* animation) { +void BackgroundAnimator::AnimationProgressed(const gfx::Animation* animation) { int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_); if (alpha_ == alpha) return; diff --git a/ash/shelf/background_animator.h b/ash/shelf/background_animator.h index dbe495a..7436b30 100644 --- a/ash/shelf/background_animator.h +++ b/ash/shelf/background_animator.h @@ -7,8 +7,8 @@ #include "ash/ash_export.h" #include "base/basictypes.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/slide_animation.h" namespace ash { namespace internal { @@ -23,7 +23,7 @@ class ASH_EXPORT BackgroundAnimatorDelegate { }; // BackgroundAnimator is used by the shelf to animate the background (alpha). -class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate { +class ASH_EXPORT BackgroundAnimator : public gfx::AnimationDelegate { public: // How the background can be changed. enum ChangeType { @@ -48,8 +48,8 @@ class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate { // Current alpha. int alpha() const { return alpha_; } - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: BackgroundAnimatorDelegate* delegate_; @@ -57,7 +57,7 @@ class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate { const int min_alpha_; const int max_alpha_; - ui::SlideAnimation animation_; + gfx::SlideAnimation animation_; // Whether the background is painted. bool paints_background_; diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc index 586b088..23de975 100644 --- a/ash/shelf/overflow_button.cc +++ b/ash/shelf/overflow_button.cc @@ -11,9 +11,9 @@ #include "grit/ash_strings.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/skbitmap_operations.h" diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 84fef37..0d94aa4 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc @@ -663,12 +663,12 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity( if (animate) { launcher_animation_setter.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); - launcher_animation_setter.SetTweenType(ui::Tween::EASE_OUT); + launcher_animation_setter.SetTweenType(gfx::Tween::EASE_OUT); launcher_animation_setter.SetPreemptionStrategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); status_animation_setter.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); - status_animation_setter.SetTweenType(ui::Tween::EASE_OUT); + status_animation_setter.SetTweenType(gfx::Tween::EASE_OUT); status_animation_setter.SetPreemptionStrategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); } else { diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 22ec93c..8cd40d9 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -32,10 +32,10 @@ #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" -#include "ui/base/animation/animation_container_element.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/gfx/animation/animation_container_element.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/views/controls/label.h" @@ -53,8 +53,8 @@ namespace internal { namespace { void StepWidgetLayerAnimatorToEnd(views::Widget* widget) { - ui::AnimationContainerElement* element = - static_cast<ui::AnimationContainerElement*>( + gfx::AnimationContainerElement* element = + static_cast<gfx::AnimationContainerElement*>( widget->GetNativeView()->layer()->GetAnimator()); element->Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); } diff --git a/ash/system/chromeos/network/network_icon_animation.cc b/ash/system/chromeos/network/network_icon_animation.cc index 2a6428c..5065745 100644 --- a/ash/system/chromeos/network/network_icon_animation.cc +++ b/ash/system/chromeos/network/network_icon_animation.cc @@ -17,13 +17,14 @@ NetworkIconAnimation::NetworkIconAnimation() : animation_(this) { // Set up the animation throbber. animation_.SetThrobDuration(kThrobDurationMs); - animation_.SetTweenType(ui::Tween::LINEAR); + animation_.SetTweenType(gfx::Tween::LINEAR); } NetworkIconAnimation::~NetworkIconAnimation() { } -void NetworkIconAnimation::AnimationProgressed(const ui::Animation* animation) { +void NetworkIconAnimation::AnimationProgressed( + const gfx::Animation* animation) { if (animation != &animation_) return; FOR_EACH_OBSERVER(AnimationObserver, observers_, NetworkIconChanged()); diff --git a/ash/system/chromeos/network/network_icon_animation.h b/ash/system/chromeos/network/network_icon_animation.h index e784f7d..a34b80e 100644 --- a/ash/system/chromeos/network/network_icon_animation.h +++ b/ash/system/chromeos/network/network_icon_animation.h @@ -10,8 +10,8 @@ #include "ash/ash_export.h" #include "base/observer_list.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/throb_animation.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/throb_animation.h" namespace ash { namespace network_icon { @@ -19,7 +19,7 @@ namespace network_icon { class AnimationObserver; // Single instance class to handle icon animations and keep them in sync. -class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate { +class ASH_EXPORT NetworkIconAnimation : public gfx::AnimationDelegate { public: NetworkIconAnimation(); virtual ~NetworkIconAnimation(); @@ -32,13 +32,13 @@ class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate { void AddObserver(AnimationObserver* observer); void RemoveObserver(AnimationObserver* observer); - // ui::AnimationDelegate implementation. - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate implementation. + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; static NetworkIconAnimation* GetInstance(); private: - ui::ThrobAnimation animation_; + gfx::ThrobAnimation animation_; ObserverList<AnimationObserver> observers_; }; diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc index eff1ffd..3477c3c 100644 --- a/ash/system/tray/system_tray_bubble.cc +++ b/ash/system/tray/system_tray_bubble.cc @@ -171,7 +171,7 @@ void SystemTrayBubble::UpdateView( settings.AddObserver( new AnimationObserverDeleteLayer(scoped_layer.release())); settings.SetTransitionDuration(swipe_duration); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); gfx::Transform transform; transform.Translate(layer->bounds().width(), 0.0); layer->SetTransform(transform); @@ -196,7 +196,7 @@ void SystemTrayBubble::UpdateView( settings.AddObserver(new AnimationObserverDeleteLayer(shadow)); settings.SetTransitionDuration(swipe_duration + base::TimeDelta::FromMilliseconds(150)); - settings.SetTweenType(ui::Tween::LINEAR); + settings.SetTweenType(gfx::Tween::LINEAR); shadow->SetOpacity(0.15f); } } @@ -242,7 +242,7 @@ void SystemTrayBubble::UpdateView( new AnimationObserverDeleteLayer(scoped_layer.release())); settings.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kSwipeDelayMS)); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); new_layer->SetTransform(gfx::Transform()); } } diff --git a/ash/system/tray/tray_item_view.cc b/ash/system/tray/tray_item_view.cc index f95ceb9..da8051b 100644 --- a/ash/system/tray/tray_item_view.cc +++ b/ash/system/tray/tray_item_view.cc @@ -7,8 +7,8 @@ #include "ash/shelf/shelf_types.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_item.h" -#include "ui/base/animation/slide_animation.h" #include "ui/compositor/layer.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" @@ -60,9 +60,9 @@ void TrayItemView::SetVisible(bool set_visible) { } if (!animation_) { - animation_.reset(new ui::SlideAnimation(this)); + animation_.reset(new gfx::SlideAnimation(this)); animation_->SetSlideDuration(GetAnimationDurationMS()); - animation_->SetTweenType(ui::Tween::LINEAR); + animation_->SetTweenType(gfx::Tween::LINEAR); animation_->Reset(visible() ? 1.0 : 0.0); } @@ -106,7 +106,7 @@ void TrayItemView::ChildPreferredSizeChanged(views::View* child) { PreferredSizeChanged(); } -void TrayItemView::AnimationProgressed(const ui::Animation* animation) { +void TrayItemView::AnimationProgressed(const gfx::Animation* animation) { gfx::Transform transform; transform.Translate(0, animation->CurrentValueBetween( static_cast<double>(height()) / 2, 0.)); @@ -116,12 +116,12 @@ void TrayItemView::AnimationProgressed(const ui::Animation* animation) { PreferredSizeChanged(); } -void TrayItemView::AnimationEnded(const ui::Animation* animation) { +void TrayItemView::AnimationEnded(const gfx::Animation* animation) { if (animation->GetCurrentValue() < 0.1) views::View::SetVisible(false); } -void TrayItemView::AnimationCanceled(const ui::Animation* animation) { +void TrayItemView::AnimationCanceled(const gfx::Animation* animation) { AnimationEnded(animation); } diff --git a/ash/system/tray/tray_item_view.h b/ash/system/tray/tray_item_view.h index e0d8ec4..761e918 100644 --- a/ash/system/tray/tray_item_view.h +++ b/ash/system/tray/tray_item_view.h @@ -6,10 +6,10 @@ #define ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ #include "ash/ash_export.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/views/view.h" -namespace ui { +namespace gfx { class SlideAnimation; } @@ -28,7 +28,7 @@ namespace internal { // correctly when the visibility/size of the tray item changes. It also adds // animation when showing/hiding the item in the tray. class ASH_EXPORT TrayItemView : public views::View, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: explicit TrayItemView(SystemTrayItem* owner); virtual ~TrayItemView(); @@ -66,13 +66,13 @@ class ASH_EXPORT TrayItemView : public views::View, // Overridden from views::View. virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; - // Overridden from ui::AnimationDelegate. - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; + // Overridden from gfx::AnimationDelegate. + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; SystemTrayItem* owner_; - scoped_ptr<ui::SlideAnimation> animation_; + scoped_ptr<gfx::SlideAnimation> animation_; views::Label* label_; views::ImageView* image_view_; diff --git a/ash/system/user/tray_user_unittest.cc b/ash/system/user/tray_user_unittest.cc index 7d7b066..3c49a1e 100644 --- a/ash/system/user/tray_user_unittest.cc +++ b/ash/system/user/tray_user_unittest.cc @@ -14,7 +14,7 @@ #include "ash/test/test_session_state_delegate.h" #include "ash/test/test_shell_delegate.h" #include "ui/aura/test/event_generator.h" -#include "ui/base/animation/animation_container_element.h" +#include "ui/gfx/animation/animation_container_element.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc index 769bffa..2953cb9 100644 --- a/ash/touch/touch_hud_debug.cc +++ b/ash/touch/touch_hud_debug.cc @@ -13,8 +13,8 @@ #include "base/strings/utf_string_conversions.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/aura/root_window.h" -#include "ui/base/animation/animation_delegate.h" #include "ui/base/events/event.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/canvas.h" #include "ui/gfx/display.h" #include "ui/gfx/size.h" diff --git a/ash/touch/touch_hud_projection.cc b/ash/touch/touch_hud_projection.cc index 00d6193..066c401 100644 --- a/ash/touch/touch_hud_projection.cc +++ b/ash/touch/touch_hud_projection.cc @@ -8,9 +8,9 @@ #include "ash/shell.h" #include "ash/wm/property_util.h" #include "third_party/skia/include/effects/SkGradientShader.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/linear_animation.h" #include "ui/base/events/event.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/size.h" #include "ui/views/widget/widget.h" @@ -29,7 +29,7 @@ const int kFadeoutFrameRate = 60; // lifetime and deletes itself upon fade-out completion or whenever |Remove()| // is explicitly called. class TouchPointView : public views::View, - public ui::AnimationDelegate, + public gfx::AnimationDelegate, public views::WidgetObserver { public: explicit TouchPointView(views::Widget* parent_widget) @@ -58,7 +58,7 @@ class TouchPointView : public views::View, void UpdateTouch(const ui::TouchEvent& touch) { if (touch.type() == ui::ET_TOUCH_RELEASED || touch.type() == ui::ET_TOUCH_CANCELLED) { - fadeout_.reset(new ui::LinearAnimation(kFadeoutDurationInMs, + fadeout_.reset(new gfx::LinearAnimation(kFadeoutDurationInMs, kFadeoutFrameRate, this)); fadeout_->Start(); @@ -102,18 +102,18 @@ class TouchPointView : public views::View, stroke_paint_); } - // Overridden from ui::AnimationDelegate. - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE { + // Overridden from gfx::AnimationDelegate. + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE { DCHECK_EQ(fadeout_.get(), animation); delete this; } - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE { DCHECK_EQ(fadeout_.get(), animation); SchedulePaint(); } - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE { + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE { AnimationEnded(animation); } @@ -130,7 +130,7 @@ class TouchPointView : public views::View, SkColor gradient_colors_[2]; SkScalar gradient_pos_[2]; - scoped_ptr<ui::Animation> fadeout_; + scoped_ptr<gfx::Animation> fadeout_; DISALLOW_COPY_AND_ASSIGN(TouchPointView); }; diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc index 45492df..3528f35 100644 --- a/ash/wm/frame_painter.cc +++ b/ash/wm/frame_painter.cc @@ -25,11 +25,11 @@ #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" -#include "ui/base/animation/slide_animation.h" #include "ui/base/hit_test.h" #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" @@ -418,7 +418,7 @@ void FramePainter::PaintHeader(views::NonClientFrameView* view, parent->layer()->GetAnimator()->IsAnimatingProperty( ui::LayerAnimationElement::VISIBILITY)); if (!parent_animating) { - crossfade_animation_.reset(new ui::SlideAnimation(this)); + crossfade_animation_.reset(new gfx::SlideAnimation(this)); crossfade_theme_frame_id_ = previous_theme_frame_id_; crossfade_theme_frame_overlay_id_ = previous_theme_frame_overlay_id_; crossfade_opacity_ = previous_opacity_; @@ -702,9 +702,9 @@ void FramePainter::OnWindowRemovingFromRootWindow(aura::Window* window) { } /////////////////////////////////////////////////////////////////////////////// -// ui::AnimationDelegate overrides: +// gfx::AnimationDelegate overrides: -void FramePainter::AnimationProgressed(const ui::Animation* animation) { +void FramePainter::AnimationProgressed(const gfx::Animation* animation) { frame_->non_client_view()->SchedulePaintInRect(header_frame_bounds_); } diff --git a/ash/wm/frame_painter.h b/ash/wm/frame_painter.h index a5d40fb..d790221 100644 --- a/ash/wm/frame_painter.h +++ b/ash/wm/frame_painter.h @@ -12,7 +12,7 @@ #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "ui/aura/window_observer.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/rect.h" namespace aura { @@ -25,8 +25,6 @@ class Font; class ImageSkia; class Point; class Size; -} -namespace ui { class SlideAnimation; } namespace views { @@ -42,7 +40,7 @@ class FrameCaptionButtonContainerView; // various implementations of views::NonClientFrameView. Canonical source of // layout constants for Ash window frames. class ASH_EXPORT FramePainter : public aura::WindowObserver, - public ui::AnimationDelegate, + public gfx::AnimationDelegate, public wm::WindowSettings::Observer { public: // Opacity values for the window header in various states, from 0 to 255. @@ -151,8 +149,8 @@ class ASH_EXPORT FramePainter : public aura::WindowObserver, virtual void OnTrackedByWorkspaceChanged(aura::Window* window, bool old) OVERRIDE; - // Overridden from ui::AnimationDelegate - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // Overridden from gfx::AnimationDelegate + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(FramePainterTest, CreateAndDeleteSingleWindow); @@ -238,7 +236,7 @@ class ASH_EXPORT FramePainter : public aura::WindowObserver, int crossfade_opacity_; gfx::Rect header_frame_bounds_; - scoped_ptr<ui::SlideAnimation> crossfade_animation_; + scoped_ptr<gfx::SlideAnimation> crossfade_animation_; DISALLOW_COPY_AND_ASSIGN(FramePainter); }; diff --git a/ash/wm/gestures/long_press_affordance_handler.cc b/ash/wm/gestures/long_press_affordance_handler.cc index 8b8468f..516f4c7 100644 --- a/ash/wm/gestures/long_press_affordance_handler.cc +++ b/ash/wm/gestures/long_press_affordance_handler.cc @@ -165,7 +165,7 @@ class LongPressAffordanceHandler::LongPressAffordanceView virtual ~LongPressAffordanceView() { } - void UpdateWithGrowAnimation(ui::Animation* animation) { + void UpdateWithGrowAnimation(gfx::Animation* animation) { // Update the portion of the circle filled so far and re-draw. current_angle_ = animation->CurrentValueBetween(kAffordanceAngleStartValue, kAffordanceAngleEndValue); @@ -177,7 +177,7 @@ class LongPressAffordanceHandler::LongPressAffordanceView SchedulePaint(); } - void UpdateWithShrinkAnimation(ui::Animation* animation) { + void UpdateWithShrinkAnimation(gfx::Animation* animation) { current_scale_ = animation->CurrentValueBetween(kAffordanceScaleEndValue, kAffordanceShrinkScaleEndValue); widget_->GetNativeView()->layer()->SetOpacity( @@ -236,7 +236,7 @@ class LongPressAffordanceHandler::LongPressAffordanceView // LongPressAffordanceHandler, public LongPressAffordanceHandler::LongPressAffordanceHandler() - : ui::LinearAnimation(kAffordanceFrameRateHz, this), + : gfx::LinearAnimation(kAffordanceFrameRateHz, this), tap_down_touch_id_(-1), tap_down_display_id_(0), current_animation_type_(NONE) {} @@ -351,7 +351,7 @@ bool LongPressAffordanceHandler::ShouldSendCanceledFromStop() { } void LongPressAffordanceHandler::AnimationEnded( - const ui::Animation* animation) { + const gfx::Animation* animation) { switch (current_animation_type_) { case GROW_ANIMATION: current_animation_type_ = SHRINK_ANIMATION; diff --git a/ash/wm/gestures/long_press_affordance_handler.h b/ash/wm/gestures/long_press_affordance_handler.h index 14ff0f3..5fe6e00 100644 --- a/ash/wm/gestures/long_press_affordance_handler.h +++ b/ash/wm/gestures/long_press_affordance_handler.h @@ -6,8 +6,8 @@ #define ASH_WM_GESTURES_LONG_PRESS_AFFORDANCE_HANDLER_H_ #include "base/timer/timer.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/linear_animation.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/point.h" namespace aura { @@ -33,8 +33,8 @@ namespace internal { // during grow animation. // The second part is a shrink animation that start after grow and shrinks the // affordance out of view. -class LongPressAffordanceHandler : public ui::AnimationDelegate, - public ui::LinearAnimation { +class LongPressAffordanceHandler : public gfx::AnimationDelegate, + public gfx::LinearAnimation { public: LongPressAffordanceHandler(); virtual ~LongPressAffordanceHandler(); @@ -56,12 +56,12 @@ class LongPressAffordanceHandler : public ui::AnimationDelegate, void StartAnimation(); void StopAnimation(); - // Overridden from ui::LinearAnimation. + // Overridden from gfx::LinearAnimation. virtual void AnimateToState(double state) OVERRIDE; virtual bool ShouldSendCanceledFromStop() OVERRIDE; - // Overridden from ui::AnimationDelegate. - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; + // Overridden from gfx::AnimationDelegate. + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; class LongPressAffordanceView; scoped_ptr<LongPressAffordanceView> view_; diff --git a/ash/wm/maximize_bubble_controller.cc b/ash/wm/maximize_bubble_controller.cc index 68cbfd9..10f25b3 100644 --- a/ash/wm/maximize_bubble_controller.cc +++ b/ash/wm/maximize_bubble_controller.cc @@ -14,9 +14,9 @@ #include "grit/ash_strings.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/aura/window.h" -#include "ui/base/animation/animation.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/path.h" #include "ui/gfx/screen.h" @@ -218,7 +218,7 @@ class MaximizeBubbleController::Bubble : public views::BubbleDelegateView, // Overridden from views::BubbleDelegateView. virtual gfx::Rect GetAnchorRect() OVERRIDE; - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; virtual bool CanActivate() const OVERRIDE { return false; } // Overridden from views::WidgetDelegateView. @@ -457,7 +457,7 @@ gfx::Rect MaximizeBubbleController::Bubble::GetAnchorRect() { } void MaximizeBubbleController::Bubble::AnimationProgressed( - const ui::Animation* animation) { + const gfx::Animation* animation) { // First do everything needed for the fade by calling the base function. BubbleDelegateView::AnimationProgressed(animation); // When fading in we are done. diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/wm/panels/panel_frame_view.cc index db137fa..6f985bf 100644 --- a/ash/wm/panels/panel_frame_view.cc +++ b/ash/wm/panels/panel_frame_view.cc @@ -8,11 +8,11 @@ #include "ash/wm/workspace/frame_caption_button_container_view.h" #include "grit/ash_resources.h" #include "third_party/skia/include/core/SkPaint.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/cursor/cursor.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" diff --git a/ash/wm/session_state_animator.cc b/ash/wm/session_state_animator.cc index 35ac4cc..81e3fcc 100644 --- a/ash/wm/session_state_animator.cc +++ b/ash/wm/session_state_animator.cc @@ -163,11 +163,11 @@ void HideWindow(aura::Window* window, ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); settings.SetTransitionDuration(duration); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); SetTransformForScaleAnimation(layer, above ? LAYER_SCALE_ANIMATION_ABOVE : LAYER_SCALE_ANIMATION_BELOW); - settings.SetTweenType(ui::Tween::EASE_IN_OUT); + settings.SetTweenType(gfx::Tween::EASE_IN_OUT); layer->SetOpacity(0.0f); // After the animation completes snap the transform back to the identity, @@ -203,10 +203,10 @@ void TransformWindowToBaseState(aura::Window* window, ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); settings.SetTransitionDuration(duration); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); layer->SetTransform(gfx::Transform()); - settings.SetTweenType(ui::Tween::EASE_IN_OUT); + settings.SetTweenType(gfx::Tween::EASE_IN_OUT); layer->SetOpacity(1.0f); // A bit of a dirty trick: we need to catch the end of the animation we don't @@ -246,7 +246,7 @@ void StartGrayscaleBrightnessAnimationForWindow( aura::Window* window, float target, base::TimeDelta duration, - ui::Tween::Type tween_type, + gfx::Tween::Type tween_type, ui::LayerAnimationObserver* observer) { ui::LayerAnimator* animator = window->layer()->GetAnimator(); @@ -604,11 +604,11 @@ void SessionStateAnimator::RunAnimationForWindow( break; case ANIMATION_GRAYSCALE_BRIGHTNESS: StartGrayscaleBrightnessAnimationForWindow( - window, 1.0, duration, ui::Tween::EASE_IN, observer); + window, 1.0, duration, gfx::Tween::EASE_IN, observer); break; case ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS: StartGrayscaleBrightnessAnimationForWindow( - window, 0.0, duration, ui::Tween::EASE_IN_OUT, observer); + window, 0.0, duration, gfx::Tween::EASE_IN_OUT, observer); break; } } diff --git a/ash/wm/system_gesture_event_filter.h b/ash/wm/system_gesture_event_filter.h index a2a5c73..303751b 100644 --- a/ash/wm/system_gesture_event_filter.h +++ b/ash/wm/system_gesture_event_filter.h @@ -9,8 +9,6 @@ #include "ash/touch/touch_uma.h" #include "base/timer/timer.h" #include "ui/aura/window_observer.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/linear_animation.h" #include "ui/base/events/event_handler.h" #include "ui/gfx/point.h" diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index 73deafd..ffbe007 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -60,7 +60,7 @@ const float kWindowAnimation_ShowOpacity = 1.f; const float kWindowAnimation_MinimizeRotate = 0.f; // Tween type when cross fading a workspace window. -const ui::Tween::Type kCrossFadeTweenType = ui::Tween::EASE_IN_OUT; +const gfx::Tween::Type kCrossFadeTweenType = gfx::Tween::EASE_IN_OUT; // Scales for AshWindow above/below current workspace. const float kLayerScaleAboveSize = 1.1f; @@ -116,7 +116,7 @@ void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { rotation_about_pivot.release(), duration)); transition->set_tween_type( - show ? ui::Tween::EASE_IN : ui::Tween::EASE_IN_OUT); + show ? gfx::Tween::EASE_IN : gfx::Tween::EASE_IN_OUT); window->layer()->GetAnimator()->ScheduleAnimation( new ui::LayerAnimationSequence(transition.release())); @@ -318,7 +318,7 @@ class CrossFadeObserver : public ui::CompositorObserver, // animating. Returns the duration of the fade. base::TimeDelta CrossFadeImpl(aura::Window* window, ui::Layer* old_layer, - ui::Tween::Type tween_type) { + gfx::Tween::Type tween_type) { const gfx::Rect old_bounds(old_layer->bounds()); const gfx::Rect new_bounds(window->bounds()); const bool old_on_top = (old_bounds.width() > new_bounds.width()); @@ -413,7 +413,7 @@ void CrossFadeToBounds(aura::Window* window, const gfx::Rect& new_bounds) { else old_layer->parent()->StackAbove(new_layer, old_layer); - CrossFadeImpl(window, old_layer, ui::Tween::EASE_OUT); + CrossFadeImpl(window, old_layer, gfx::Tween::EASE_OUT); } void CrossFadeWindowBetweenWorkspaces(aura::Window* new_workspace, @@ -473,7 +473,7 @@ bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, bool visible) { std::vector<ui::LayerAnimationSequence*> CreateBrightnessGrayscaleAnimationSequence(float target_value, base::TimeDelta duration) { - ui::Tween::Type animation_type = ui::Tween::EASE_OUT; + gfx::Tween::Type animation_type = gfx::Tween::EASE_OUT; scoped_ptr<ui::LayerAnimationSequence> brightness_sequence( new ui::LayerAnimationSequence()); scoped_ptr<ui::LayerAnimationSequence> grayscale_sequence( diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc index d5680cc..c2ea1f6 100644 --- a/ash/wm/window_animations_unittest.cc +++ b/ash/wm/window_animations_unittest.cc @@ -10,10 +10,10 @@ #include "base/time/time.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" -#include "ui/base/animation/animation_container_element.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/gfx/animation/animation_container_element.h" using aura::Window; using ui::Layer; @@ -57,8 +57,8 @@ TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { EXPECT_TRUE(window->layer()->visible()); // Stays shown. - ui::AnimationContainerElement* element = - static_cast<ui::AnimationContainerElement*>( + gfx::AnimationContainerElement* element = + static_cast<gfx::AnimationContainerElement*>( window->layer()->GetAnimator()); element->Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(5)); @@ -106,9 +106,9 @@ TEST_F(WindowAnimationsTest, CrossFadeToBounds) { EXPECT_EQ(gfx::Transform(), window->layer()->GetTargetTransform()); // Run the animations to completion. - static_cast<ui::AnimationContainerElement*>(old_layer->GetAnimator())->Step( + static_cast<gfx::AnimationContainerElement*>(old_layer->GetAnimator())->Step( base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); - static_cast<ui::AnimationContainerElement*>(window->layer()->GetAnimator())-> + static_cast<gfx::AnimationContainerElement*>(window->layer()->GetAnimator())-> Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); // Cross fade to a smaller size, as in a restore animation. @@ -127,9 +127,9 @@ TEST_F(WindowAnimationsTest, CrossFadeToBounds) { EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity()); EXPECT_EQ(gfx::Transform(), window->layer()->GetTargetTransform()); - static_cast<ui::AnimationContainerElement*>(old_layer->GetAnimator())->Step( + static_cast<gfx::AnimationContainerElement*>(old_layer->GetAnimator())->Step( base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); - static_cast<ui::AnimationContainerElement*>(window->layer()->GetAnimator())-> + static_cast<gfx::AnimationContainerElement*>(window->layer()->GetAnimator())-> Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1)); } diff --git a/ash/wm/workspace/alternate_frame_caption_button.cc b/ash/wm/workspace/alternate_frame_caption_button.cc index ffdb539..578e46a6 100644 --- a/ash/wm/workspace/alternate_frame_caption_button.cc +++ b/ash/wm/workspace/alternate_frame_caption_button.cc @@ -4,7 +4,7 @@ #include "ash/wm/workspace/alternate_frame_caption_button.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" namespace ash { @@ -96,7 +96,7 @@ AlternateFrameCaptionButton::AlternateFrameCaptionButton( action_(action), hidden_bubble_radius_(0), shown_bubble_radius_(0), - bubble_animation_(new ui::SlideAnimation(this)) { + bubble_animation_(new gfx::SlideAnimation(this)) { } AlternateFrameCaptionButton::~AlternateFrameCaptionButton() { @@ -216,12 +216,12 @@ void AlternateFrameCaptionButton::StateChanged() { } void AlternateFrameCaptionButton::AnimationProgressed( - const ui::Animation* animation) { + const gfx::Animation* animation) { SchedulePaint(); } void AlternateFrameCaptionButton::AnimationEnded( - const ui::Animation* animation) { + const gfx::Animation* animation) { // The bubble animation was postponed if the button became pressed when the // bubble was fading out. Do the animation now. MaybeStartNewBubbleAnimation(); diff --git a/ash/wm/workspace/alternate_frame_caption_button.h b/ash/wm/workspace/alternate_frame_caption_button.h index b0f9581..7f5e28f 100644 --- a/ash/wm/workspace/alternate_frame_caption_button.h +++ b/ash/wm/workspace/alternate_frame_caption_button.h @@ -9,7 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "ui/views/controls/button/custom_button.h" -namespace ui { +namespace gfx { class SlideAnimation; } @@ -47,9 +47,9 @@ class ASH_EXPORT AlternateFrameCaptionButton : public views::CustomButton { virtual void StateChanged() OVERRIDE; // ui::AnimateDelegate overrides. (views::CustomButton inherits from - // ui::AnimationDelegate). - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate). + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; Action action_; @@ -59,7 +59,7 @@ class ASH_EXPORT AlternateFrameCaptionButton : public views::CustomButton { // The radius of the background bubble when it is visible. double shown_bubble_radius_; - scoped_ptr<ui::SlideAnimation> bubble_animation_; + scoped_ptr<gfx::SlideAnimation> bubble_animation_; DISALLOW_COPY_AND_ASSIGN(AlternateFrameCaptionButton); }; diff --git a/ash/wm/workspace/desktop_background_fade_controller.cc b/ash/wm/workspace/desktop_background_fade_controller.cc index 563d07b..abbdf57 100644 --- a/ash/wm/workspace/desktop_background_fade_controller.cc +++ b/ash/wm/workspace/desktop_background_fade_controller.cc @@ -20,15 +20,15 @@ DesktopBackgroundFadeController::DesktopBackgroundFadeController( base::TimeDelta duration, Direction direction) { SkColor start_color, target_color; - ui::Tween::Type tween_type; + gfx::Tween::Type tween_type; if (direction == FADE_OUT) { start_color = SkColorSetARGB(0, 0, 0, 0); target_color = SK_ColorBLACK; - tween_type = ui::Tween::EASE_IN_OUT; + tween_type = gfx::Tween::EASE_IN_OUT; } else { start_color = SK_ColorBLACK; target_color = SkColorSetARGB(0, 0, 0, 0); - tween_type = ui::Tween::EASE_IN_OUT; + tween_type = gfx::Tween::EASE_IN_OUT; } window_controller_.reset( diff --git a/ash/wm/workspace/phantom_window_controller.cc b/ash/wm/workspace/phantom_window_controller.cc index 67272c1..cd2865e 100644 --- a/ash/wm/workspace/phantom_window_controller.cc +++ b/ash/wm/workspace/phantom_window_controller.cc @@ -10,9 +10,9 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" -#include "ui/base/animation/slide_animation.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/skia_util.h" #include "ui/views/painter.h" @@ -142,8 +142,8 @@ void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) { if (!phantom_widget_start_ && start_root != target_root) phantom_widget_start_ = CreatePhantomWidget(start_root, start_bounds_); - animation_.reset(new ui::SlideAnimation(this)); - animation_->SetTweenType(ui::Tween::EASE_IN); + animation_.reset(new gfx::SlideAnimation(this)); + animation_->SetTweenType(gfx::Tween::EASE_IN); const int kAnimationDurationMS = 200; animation_->SetSlideDuration(kAnimationDurationMS); animation_->Show(); @@ -163,7 +163,7 @@ bool PhantomWindowController::IsShowing() const { } void PhantomWindowController::AnimationProgressed( - const ui::Animation* animation) { + const gfx::Animation* animation) { const gfx::Rect current_bounds = animation->CurrentValueBetween(start_bounds_, bounds_in_screen_); if (phantom_widget_start_) diff --git a/ash/wm/workspace/phantom_window_controller.h b/ash/wm/workspace/phantom_window_controller.h index 5cd40da..4a92792 100644 --- a/ash/wm/workspace/phantom_window_controller.h +++ b/ash/wm/workspace/phantom_window_controller.h @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/rect.h" namespace aura { @@ -17,7 +17,7 @@ class RootWindow; class Window; } -namespace ui { +namespace gfx { class SlideAnimation; } @@ -30,7 +30,7 @@ namespace internal { // PhantomWindowController is responsible for showing a phantom representation // of a window. It's used used during dragging a window to show a snap location. -class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { +class ASH_EXPORT PhantomWindowController : public gfx::AnimationDelegate { public: explicit PhantomWindowController(aura::Window* window); virtual ~PhantomWindowController(); @@ -57,8 +57,8 @@ class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { phantom_below_window_ = phantom_below_window; } - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, PhantomWindowShow); @@ -93,7 +93,7 @@ class ASH_EXPORT PhantomWindowController : public ui::AnimationDelegate { views::Widget* phantom_widget_start_; // Used to transition the bounds. - scoped_ptr<ui::SlideAnimation> animation_; + scoped_ptr<gfx::SlideAnimation> animation_; DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); }; diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 62eb380..5f096d0 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -31,9 +31,10 @@ #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" -namespace ui { +namespace gfx { // Class to provide access to SlideAnimation internals for testing. +// TODO: this should be next to SlideAnimation, not here. class SlideAnimation::TestApi { public: explicit TestApi(SlideAnimation* animation) : animation_(animation) {} @@ -202,8 +203,8 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { } // Simulate running the animation. - void RunAnimationTillComplete(ui::SlideAnimation* animation) { - ui::SlideAnimation::TestApi test_api(animation); + void RunAnimationTillComplete(gfx::SlideAnimation* animation) { + gfx::SlideAnimation::TestApi test_api(animation); test_api.RunTillComplete(); } diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc index 64e69e2..8e63d34 100644 --- a/ash/wm/workspace_controller.cc +++ b/ash/wm/workspace_controller.cc @@ -116,7 +116,7 @@ void WorkspaceController::DoInitialAnimation() { ui::LayerAnimationElement::VISIBILITY, -1); - settings.SetTweenType(ui::Tween::EASE_OUT); + settings.SetTweenType(gfx::Tween::EASE_OUT); settings.SetTransitionDuration( base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); viewport_->layer()->SetTransform(gfx::Transform()); |