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 /ui | |
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 'ui')
76 files changed, 405 insertions, 378 deletions
diff --git a/ui/app_list/pagination_model.cc b/ui/app_list/pagination_model.cc index 2bf6902..02a4179 100644 --- a/ui/app_list/pagination_model.cc +++ b/ui/app_list/pagination_model.cc @@ -7,7 +7,7 @@ #include <algorithm> #include "ui/app_list/pagination_model_observer.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" namespace app_list { @@ -221,8 +221,8 @@ void PaginationModel::StartTransitionAnimation(const Transition& transition) { NotifyTransitionStarted(); SetTransition(transition); - transition_animation_.reset(new ui::SlideAnimation(this)); - transition_animation_->SetTweenType(ui::Tween::LINEAR); + transition_animation_.reset(new gfx::SlideAnimation(this)); + transition_animation_->SetTweenType(gfx::Tween::LINEAR); transition_animation_->Reset(transition_.progress); const int duration = is_valid_page(transition_.target_page) ? @@ -240,12 +240,12 @@ void PaginationModel::ResetTransitionAnimation() { pending_selected_page_ = -1; } -void PaginationModel::AnimationProgressed(const ui::Animation* animation) { +void PaginationModel::AnimationProgressed(const gfx::Animation* animation) { transition_.progress = transition_animation_->GetCurrentValue(); NotifyTransitionChanged(); } -void PaginationModel::AnimationEnded(const ui::Animation* animation) { +void PaginationModel::AnimationEnded(const gfx::Animation* animation) { // Save |pending_selected_page_| because SelectPage resets it. int next_target = pending_selected_page_; diff --git a/ui/app_list/pagination_model.h b/ui/app_list/pagination_model.h index 00ddd96..0546adc 100644 --- a/ui/app_list/pagination_model.h +++ b/ui/app_list/pagination_model.h @@ -11,9 +11,9 @@ #include "base/observer_list.h" #include "base/time/time.h" #include "ui/app_list/app_list_export.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" -namespace ui { +namespace gfx { class SlideAnimation; } @@ -24,7 +24,7 @@ class PaginationModelObserver; // A simple pagination model that consists of two numbers: the total pages and // the currently selected page. The model is a single selection model that at // the most one page can become selected at any time. -class APP_LIST_EXPORT PaginationModel : public ui::AnimationDelegate { +class APP_LIST_EXPORT PaginationModel : public gfx::AnimationDelegate { public: // Holds info for transition animation and touch scroll. struct Transition { @@ -113,9 +113,9 @@ class APP_LIST_EXPORT PaginationModel : public ui::AnimationDelegate { void StartTransitionAnimation(const Transition& transition); void ResetTransitionAnimation(); - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; int total_pages_; int selected_page_; @@ -127,7 +127,7 @@ class APP_LIST_EXPORT PaginationModel : public ui::AnimationDelegate { // last target page is remembered here. int pending_selected_page_; - scoped_ptr<ui::SlideAnimation> transition_animation_; + scoped_ptr<gfx::SlideAnimation> transition_animation_; int transition_duration_ms_; // Transition duration in millisecond. int overscroll_transition_duration_ms_; diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc index a5ab09d..2717f51 100644 --- a/ui/app_list/views/app_list_item_view.cc +++ b/ui/app_list/views/app_list_item_view.cc @@ -13,11 +13,11 @@ #include "ui/app_list/views/cached_label.h" #include "ui/app_list/views/progress_bar_view.h" #include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/dragdrop/drag_utils.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/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image_skia_operations.h" diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc index 4d777cb..7cb9446 100644 --- a/ui/app_list/views/apps_grid_view.cc +++ b/ui/app_list/views/apps_grid_view.cc @@ -13,9 +13,9 @@ #include "ui/app_list/views/apps_grid_view_delegate.h" #include "ui/app_list/views/page_switcher.h" #include "ui/app_list/views/pulsing_block_view.h" -#include "ui/base/animation/animation.h" #include "ui/base/events/event.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/gfx/animation/animation.h" #include "ui/views/border.h" #include "ui/views/view_model_utils.h" #include "ui/views/widget/widget.h" @@ -88,8 +88,8 @@ class RowMoveAnimationDelegate } virtual ~RowMoveAnimationDelegate() {} - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE { view_->layer()->SetOpacity(animation->GetCurrentValue()); view_->layer()->ScheduleDraw(); @@ -100,11 +100,11 @@ class RowMoveAnimationDelegate layer_->ScheduleDraw(); } } - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE { + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE { view_->layer()->SetOpacity(1.0f); view_->layer()->ScheduleDraw(); } - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE { + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE { view_->layer()->SetOpacity(1.0f); view_->layer()->ScheduleDraw(); } diff --git a/ui/app_list/views/page_switcher.cc b/ui/app_list/views/page_switcher.cc index f8690a7..99e9749 100644 --- a/ui/app_list/views/page_switcher.cc +++ b/ui/app_list/views/page_switcher.cc @@ -9,7 +9,7 @@ #include "third_party/skia/include/core/SkPath.h" #include "ui/app_list/app_list_constants.h" #include "ui/app_list/pagination_model.h" -#include "ui/base/animation/throb_animation.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/skia_util.h" #include "ui/views/controls/button/custom_button.h" diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 6053c0b..b140482 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -25,9 +25,9 @@ #include "ui/aura/window_delegate.h" #include "ui/aura/window_observer.h" #include "ui/aura/window_tracker.h" -#include "ui/base/animation/multi_animation.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" +#include "ui/gfx/animation/multi_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/path.h" #include "ui/gfx/screen.h" diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 320d1a61..4c16f9d 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -1780,7 +1780,7 @@ TEST_F(WindowTest, SetBoundsInternalShouldCheckTargetBounds) { EXPECT_FALSE(!w1->layer()); w1->layer()->GetAnimator()->set_disable_timer_for_test(true); - ui::AnimationContainerElement* element = w1->layer()->GetAnimator(); + gfx::AnimationContainerElement* element = w1->layer()->GetAnimator(); EXPECT_EQ("0,0 100x100", w1->bounds().ToString()); EXPECT_EQ("0,0 100x100", w1->layer()->GetTargetBounds().ToString()); @@ -2740,7 +2740,7 @@ TEST_F(WindowTest, DelegateNotifiedAsBoundsChange) { // Animate to the end, which should notify of the change. base::TimeTicks start_time = window->layer()->GetAnimator()->last_step_time(); - ui::AnimationContainerElement* element = window->layer()->GetAnimator(); + gfx::AnimationContainerElement* element = window->layer()->GetAnimator(); element->Step(start_time + base::TimeDelta::FromMilliseconds(1000)); EXPECT_TRUE(delegate.bounds_changed()); EXPECT_NE("0,0 100x100", window->bounds().ToString()); @@ -2782,7 +2782,7 @@ TEST_F(WindowTest, DelegateNotifiedAsBoundsChangeInHiddenLayer) { // Animate to the end: will *not* notify of the change since we are hidden. base::TimeTicks start_time = window->layer()->GetAnimator()->last_step_time(); - ui::AnimationContainerElement* element = window->layer()->GetAnimator(); + gfx::AnimationContainerElement* element = window->layer()->GetAnimator(); element->Step(start_time + base::TimeDelta::FromMilliseconds(1000)); // No bounds changed notification at the end of animation since layer diff --git a/ui/compositor/float_animation_curve_adapter.cc b/ui/compositor/float_animation_curve_adapter.cc index e97fbf0..ec41f96 100644 --- a/ui/compositor/float_animation_curve_adapter.cc +++ b/ui/compositor/float_animation_curve_adapter.cc @@ -7,7 +7,7 @@ namespace ui { FloatAnimationCurveAdapter::FloatAnimationCurveAdapter( - Tween::Type tween_type, + gfx::Tween::Type tween_type, float initial_value, float target_value, base::TimeDelta duration) @@ -36,9 +36,10 @@ float FloatAnimationCurveAdapter::GetValue(double t) const { if (t <= 0.0) return initial_value_; double progress = t / duration_.InSecondsF(); - return Tween::ValueBetween(Tween::CalculateValue(tween_type_, progress), - initial_value_, - target_value_); + return gfx::Tween::ValueBetween( + gfx::Tween::CalculateValue(tween_type_, progress), + initial_value_, + target_value_); } } // namespace ui diff --git a/ui/compositor/float_animation_curve_adapter.h b/ui/compositor/float_animation_curve_adapter.h index 0e073aa..9959772 100644 --- a/ui/compositor/float_animation_curve_adapter.h +++ b/ui/compositor/float_animation_curve_adapter.h @@ -7,13 +7,13 @@ #include "base/time/time.h" #include "cc/animation/animation_curve.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/tween.h" namespace ui { class FloatAnimationCurveAdapter : public cc::FloatAnimationCurve { public: - FloatAnimationCurveAdapter(Tween::Type tween_type, + FloatAnimationCurveAdapter(gfx::Tween::Type tween_type, float initial_value, float target_value, base::TimeDelta duration); @@ -26,7 +26,7 @@ class FloatAnimationCurveAdapter : public cc::FloatAnimationCurve { virtual float GetValue(double t) const OVERRIDE; private: - Tween::Type tween_type_; + gfx::Tween::Type tween_type_; float initial_value_; float target_value_; base::TimeDelta duration_; diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index 357a9f9..1d30d91 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -20,10 +20,10 @@ #include "cc/output/filter_operation.h" #include "cc/output/filter_operations.h" #include "cc/resources/transferable_resource.h" -#include "ui/base/animation/animation.h" #include "ui/compositor/compositor_switches.h" #include "ui/compositor/dip_util.h" #include "ui/compositor/layer_animator.h" +#include "ui/gfx/animation/animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/display.h" #include "ui/gfx/interpolated_transform.h" diff --git a/ui/compositor/layer_animation_element.cc b/ui/compositor/layer_animation_element.cc index 16f7487..1448660 100644 --- a/ui/compositor/layer_animation_element.cc +++ b/ui/compositor/layer_animation_element.cc @@ -7,13 +7,13 @@ #include "base/compiler_specific.h" #include "cc/animation/animation.h" #include "cc/animation/animation_id_provider.h" -#include "ui/base/animation/tween.h" #include "ui/compositor/float_animation_curve_adapter.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_delegate.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/transform_animation_curve_adapter.h" +#include "ui/gfx/animation/tween.h" #include "ui/gfx/interpolated_transform.h" namespace ui { @@ -63,7 +63,7 @@ class TransformTransition : public LayerAnimationElement { virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { delegate->SetTransformFromAnimation( - Tween::ValueBetween(t, start_, target_)); + gfx::Tween::ValueBetween(t, start_, target_)); return true; } @@ -141,7 +141,8 @@ class BoundsTransition : public LayerAnimationElement { } virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { - delegate->SetBoundsFromAnimation(Tween::ValueBetween(t, start_, target_)); + delegate->SetBoundsFromAnimation( + gfx::Tween::ValueBetween(t, start_, target_)); return true; } @@ -181,7 +182,8 @@ class OpacityTransition : public LayerAnimationElement { } virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { - delegate->SetOpacityFromAnimation(Tween::ValueBetween(t, start_, target_)); + delegate->SetOpacityFromAnimation( + gfx::Tween::ValueBetween(t, start_, target_)); return true; } @@ -262,7 +264,7 @@ class BrightnessTransition : public LayerAnimationElement { virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { delegate->SetBrightnessFromAnimation( - Tween::ValueBetween(t, start_, target_)); + gfx::Tween::ValueBetween(t, start_, target_)); return true; } @@ -303,7 +305,7 @@ class GrayscaleTransition : public LayerAnimationElement { virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { delegate->SetGrayscaleFromAnimation( - Tween::ValueBetween(t, start_, target_)); + gfx::Tween::ValueBetween(t, start_, target_)); return true; } @@ -345,18 +347,18 @@ class ColorTransition : public LayerAnimationElement { virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { delegate->SetColorFromAnimation( SkColorSetARGB( - Tween::ValueBetween(t, - static_cast<int>(SkColorGetA(start_)), - static_cast<int>(SkColorGetA(target_))), - Tween::ValueBetween(t, - static_cast<int>(SkColorGetR(start_)), - static_cast<int>(SkColorGetR(target_))), - Tween::ValueBetween(t, - static_cast<int>(SkColorGetG(start_)), - static_cast<int>(SkColorGetG(target_))), - Tween::ValueBetween(t, - static_cast<int>(SkColorGetB(start_)), - static_cast<int>(SkColorGetB(target_))))); + gfx::Tween::ValueBetween(t, + static_cast<int>(SkColorGetA(start_)), + static_cast<int>(SkColorGetA(target_))), + gfx::Tween::ValueBetween(t, + static_cast<int>(SkColorGetR(start_)), + static_cast<int>(SkColorGetR(target_))), + gfx::Tween::ValueBetween(t, + static_cast<int>(SkColorGetG(start_)), + static_cast<int>(SkColorGetG(target_))), + gfx::Tween::ValueBetween(t, + static_cast<int>(SkColorGetB(start_)), + static_cast<int>(SkColorGetB(target_))))); return true; } @@ -457,10 +459,10 @@ class ThreadedOpacityTransition : public ThreadedLayerAnimationElement { virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE { if (delegate && Started()) { ThreadedLayerAnimationElement::OnAbort(delegate); - delegate->SetOpacityFromAnimation(Tween::ValueBetween( - Tween::CalculateValue(tween_type(), last_progressed_fraction()), - start_, - target_)); + delegate->SetOpacityFromAnimation(gfx::Tween::ValueBetween( + gfx::Tween::CalculateValue(tween_type(), last_progressed_fraction()), + start_, + target_)); } } @@ -523,8 +525,8 @@ class ThreadedTransformTransition : public ThreadedLayerAnimationElement { virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE { if (delegate && Started()) { ThreadedLayerAnimationElement::OnAbort(delegate); - delegate->SetTransformFromAnimation(Tween::ValueBetween( - Tween::CalculateValue(tween_type(), last_progressed_fraction()), + delegate->SetTransformFromAnimation(gfx::Tween::ValueBetween( + gfx::Tween::CalculateValue(tween_type(), last_progressed_fraction()), start_, target_)); } @@ -645,8 +647,8 @@ class InverseTransformTransition : public ThreadedLayerAnimationElement { private: gfx::Transform ComputeCurrentTransform() const { - gfx::Transform base_current = Tween::ValueBetween( - Tween::CalculateValue(tween_type(), last_progressed_fraction()), + gfx::Transform base_current = gfx::Tween::ValueBetween( + gfx::Tween::CalculateValue(tween_type(), last_progressed_fraction()), base_transform_, base_target_); return ComputeWithBaseTransform(effective_start_, base_current); @@ -720,7 +722,7 @@ LayerAnimationElement::LayerAnimationElement( : first_frame_(true), properties_(properties), duration_(GetEffectiveDuration(duration)), - tween_type_(Tween::LINEAR), + tween_type_(gfx::Tween::LINEAR), animation_id_(cc::AnimationIdProvider::NextAnimationId()), animation_group_id_(0), last_progressed_fraction_(0.0) { @@ -770,7 +772,7 @@ bool LayerAnimationElement::Progress(base::TimeTicks now, base::TimeDelta elapsed = now - effective_start_time_; if ((duration_ > base::TimeDelta()) && (elapsed < duration_)) t = elapsed.InMillisecondsF() / duration_.InMillisecondsF(); - need_draw = OnProgress(Tween::CalculateValue(tween_type_, t), delegate); + need_draw = OnProgress(gfx::Tween::CalculateValue(tween_type_, t), delegate); first_frame_ = t == 1.0; last_progressed_fraction_ = t; return need_draw; diff --git a/ui/compositor/layer_animation_element.h b/ui/compositor/layer_animation_element.h index 9b969f1f..0c8a075 100644 --- a/ui/compositor/layer_animation_element.h +++ b/ui/compositor/layer_animation_element.h @@ -11,8 +11,8 @@ #include "cc/animation/animation.h" #include "cc/animation/animation_events.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/base/animation/tween.h" #include "ui/compositor/compositor_export.h" +#include "ui/gfx/animation/tween.h" #include "ui/gfx/rect.h" #include "ui/gfx/transform.h" @@ -182,8 +182,8 @@ class COMPOSITOR_EXPORT LayerAnimationElement { // Whether this element animates on the compositor thread. virtual bool IsThreaded() const; - Tween::Type tween_type() const { return tween_type_; } - void set_tween_type(Tween::Type tween_type) { tween_type_ = tween_type; } + gfx::Tween::Type tween_type() const { return tween_type_; } + void set_tween_type(gfx::Tween::Type tween_type) { tween_type_ = tween_type; } // Each LayerAnimationElement has a unique animation_id. Elements belonging // to sequences that are supposed to start together have the same @@ -224,7 +224,7 @@ class COMPOSITOR_EXPORT LayerAnimationElement { // When the animation actually started, taking into account queueing delays. base::TimeTicks effective_start_time_; const base::TimeDelta duration_; - Tween::Type tween_type_; + gfx::Tween::Type tween_type_; const int animation_id_; int animation_group_id_; diff --git a/ui/compositor/layer_animation_element_unittest.cc b/ui/compositor/layer_animation_element_unittest.cc index 153f1df..8871a2c9 100644 --- a/ui/compositor/layer_animation_element_unittest.cc +++ b/ui/compositor/layer_animation_element_unittest.cc @@ -366,7 +366,7 @@ TEST(LayerAnimationElementTest, AbortOpacityElement) { LayerAnimationElement::CreateOpacityElement(target, delta)); // Choose a non-linear Tween type. - Tween::Type tween_type = Tween::EASE_IN; + gfx::Tween::Type tween_type = gfx::Tween::EASE_IN; element->set_tween_type(tween_type); delegate.SetOpacityFromAnimation(start); @@ -387,7 +387,7 @@ TEST(LayerAnimationElementTest, AbortOpacityElement) { // Since the element has started, it should update the delegate when // aborted. element->Abort(&delegate); - EXPECT_FLOAT_EQ(Tween::CalculateValue(tween_type, 0.5), + EXPECT_FLOAT_EQ(gfx::Tween::CalculateValue(tween_type, 0.5), delegate.GetOpacityForAnimation()); } @@ -405,7 +405,7 @@ TEST(LayerAnimationElementTest, AbortTransformElement) { LayerAnimationElement::CreateTransformElement(target_transform, delta)); // Choose a non-linear Tween type. - Tween::Type tween_type = Tween::EASE_IN; + gfx::Tween::Type tween_type = gfx::Tween::EASE_IN; element->set_tween_type(tween_type); delegate.SetTransformFromAnimation(start_transform); @@ -427,7 +427,7 @@ TEST(LayerAnimationElementTest, AbortTransformElement) { // aborted. element->Abort(&delegate); target_transform.Blend(start_transform, - Tween::CalculateValue(tween_type, 0.5)); + gfx::Tween::CalculateValue(tween_type, 0.5)); CheckApproximatelyEqual(target_transform, delegate.GetTransformForAnimation()); } diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc index 4b1e981..c287574 100644 --- a/ui/compositor/layer_animator.cc +++ b/ui/compositor/layer_animator.cc @@ -8,12 +8,12 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "cc/animation/animation_id_provider.h" -#include "ui/base/animation/animation_container.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_delegate.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/layer_animation_sequence.h" +#include "ui/gfx/animation/animation_container.h" #define SAFE_INVOKE_VOID(function, running_anim, ...) \ if (running_anim.is_sequence_alive()) \ @@ -37,10 +37,10 @@ const int kDefaultTransitionDurationMs = 120; const int kTimerIntervalMs = 10; // Returns the AnimationContainer we're added to. -ui::AnimationContainer* GetAnimationContainer() { - static ui::AnimationContainer* container = NULL; +gfx::AnimationContainer* GetAnimationContainer() { + static gfx::AnimationContainer* container = NULL; if (!container) { - container = new AnimationContainer(); + container = new gfx::AnimationContainer(); container->AddRef(); } return container; @@ -54,7 +54,7 @@ LayerAnimator::LayerAnimator(base::TimeDelta transition_duration) : delegate_(NULL), preemption_strategy_(IMMEDIATELY_SET_NEW_TARGET), transition_duration_(transition_duration), - tween_type_(Tween::LINEAR), + tween_type_(gfx::Tween::LINEAR), is_started_(false), disable_timer_for_test_(false), adding_animations_(false) { diff --git a/ui/compositor/layer_animator.h b/ui/compositor/layer_animator.h index 7d6392e..5fe0d5c 100644 --- a/ui/compositor/layer_animator.h +++ b/ui/compositor/layer_animator.h @@ -13,18 +13,18 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/time/time.h" -#include "ui/base/animation/animation_container_element.h" -#include "ui/base/animation/tween.h" #include "ui/compositor/compositor_export.h" #include "ui/compositor/layer_animation_element.h" +#include "ui/gfx/animation/animation_container_element.h" +#include "ui/gfx/animation/tween.h" namespace gfx { +class Animation; class Rect; class Transform; } namespace ui { -class Animation; class Layer; class LayerAnimationSequence; class LayerAnimationDelegate; @@ -41,7 +41,8 @@ class ScopedLayerAnimationSettings; // by holding a reference to itself for the duration of methods for which it // must guarantee that |this| is valid. class COMPOSITOR_EXPORT LayerAnimator - : public AnimationContainerElement, public base::RefCounted<LayerAnimator> { + : public gfx::AnimationContainerElement, + public base::RefCounted<LayerAnimator> { public: enum PreemptionStrategy { IMMEDIATELY_SET_NEW_TARGET, @@ -171,8 +172,8 @@ class COMPOSITOR_EXPORT LayerAnimator // This determines how implicit animations will be tweened. This has no // effect on animations that are explicitly started or scheduled. The default // is Tween::LINEAR. - void set_tween_type(Tween::Type tween_type) { tween_type_ = tween_type; } - Tween::Type tween_type() const { return tween_type_; } + void set_tween_type(gfx::Tween::Type tween_type) { tween_type_ = tween_type; } + gfx::Tween::Type tween_type() const { return tween_type_; } // For testing purposes only. void set_disable_timer_for_test(bool disable_timer) { @@ -320,7 +321,7 @@ class COMPOSITOR_EXPORT LayerAnimator base::TimeDelta transition_duration_; // The default tween type for implicit transitions - Tween::Type tween_type_; + gfx::Tween::Type tween_type_; // Used for coordinating the starting of animations. base::TimeTicks last_step_time_; diff --git a/ui/compositor/layer_animator_unittest.cc b/ui/compositor/layer_animator_unittest.cc index 9d4993d..b01a1c3 100644 --- a/ui/compositor/layer_animator_unittest.cc +++ b/ui/compositor/layer_animator_unittest.cc @@ -23,6 +23,8 @@ #include "ui/gfx/rect.h" #include "ui/gfx/transform.h" +using gfx::AnimationContainerElement; + namespace ui { namespace { diff --git a/ui/compositor/scoped_layer_animation_settings.cc b/ui/compositor/scoped_layer_animation_settings.cc index c5ec4ef..b5bad67 100644 --- a/ui/compositor/scoped_layer_animation_settings.cc +++ b/ui/compositor/scoped_layer_animation_settings.cc @@ -120,11 +120,11 @@ base::TimeDelta ScopedLayerAnimationSettings::GetTransitionDuration() const { return animator_->transition_duration_; } -void ScopedLayerAnimationSettings::SetTweenType(Tween::Type tween_type) { +void ScopedLayerAnimationSettings::SetTweenType(gfx::Tween::Type tween_type) { animator_->set_tween_type(tween_type); } -Tween::Type ScopedLayerAnimationSettings::GetTweenType() const { +gfx::Tween::Type ScopedLayerAnimationSettings::GetTweenType() const { return animator_->tween_type(); } diff --git a/ui/compositor/scoped_layer_animation_settings.h b/ui/compositor/scoped_layer_animation_settings.h index 4e94eee..e36b853 100644 --- a/ui/compositor/scoped_layer_animation_settings.h +++ b/ui/compositor/scoped_layer_animation_settings.h @@ -10,9 +10,9 @@ #include "base/memory/scoped_vector.h" #include "base/time/time.h" -#include "ui/base/animation/tween.h" #include "ui/compositor/compositor_export.h" #include "ui/compositor/layer_animator.h" +#include "ui/gfx/animation/tween.h" namespace ui { @@ -34,8 +34,8 @@ class COMPOSITOR_EXPORT ScopedLayerAnimationSettings { void SetTransitionDuration(base::TimeDelta duration); base::TimeDelta GetTransitionDuration() const; - void SetTweenType(Tween::Type tween_type); - Tween::Type GetTweenType() const; + void SetTweenType(gfx::Tween::Type tween_type); + gfx::Tween::Type GetTweenType() const; void SetPreemptionStrategy(LayerAnimator::PreemptionStrategy strategy); LayerAnimator::PreemptionStrategy GetPreemptionStrategy() const; @@ -51,7 +51,7 @@ class COMPOSITOR_EXPORT ScopedLayerAnimationSettings { private: LayerAnimator* animator_; base::TimeDelta old_transition_duration_; - Tween::Type old_tween_type_; + gfx::Tween::Type old_tween_type_; LayerAnimator::PreemptionStrategy old_preemption_strategy_; std::set<ImplicitAnimationObserver*> observers_; scoped_ptr<InvertingObserver> inverse_observer_; diff --git a/ui/compositor/transform_animation_curve_adapter.cc b/ui/compositor/transform_animation_curve_adapter.cc index 2fa941e..49feb6a 100644 --- a/ui/compositor/transform_animation_curve_adapter.cc +++ b/ui/compositor/transform_animation_curve_adapter.cc @@ -7,7 +7,7 @@ namespace ui { TransformAnimationCurveAdapter::TransformAnimationCurveAdapter( - Tween::Type tween_type, + gfx::Tween::Type tween_type, gfx::Transform initial_value, gfx::Transform target_value, base::TimeDelta duration) @@ -47,7 +47,8 @@ gfx::Transform TransformAnimationCurveAdapter::GetValue( gfx::BlendDecomposedTransforms(&to_return, decomposed_target_value_, decomposed_initial_value_, - Tween::CalculateValue(tween_type_, progress)); + gfx::Tween::CalculateValue(tween_type_, + progress)); return gfx::ComposeTransform(to_return); } diff --git a/ui/compositor/transform_animation_curve_adapter.h b/ui/compositor/transform_animation_curve_adapter.h index 7c15a49..36861e4 100644 --- a/ui/compositor/transform_animation_curve_adapter.h +++ b/ui/compositor/transform_animation_curve_adapter.h @@ -7,8 +7,8 @@ #include "base/time/time.h" #include "cc/animation/animation_curve.h" -#include "ui/base/animation/tween.h" #include "ui/compositor/compositor_export.h" +#include "ui/gfx/animation/tween.h" #include "ui/gfx/transform.h" #include "ui/gfx/transform_util.h" @@ -17,7 +17,7 @@ namespace ui { class COMPOSITOR_EXPORT TransformAnimationCurveAdapter : public cc::TransformAnimationCurve { public: - TransformAnimationCurveAdapter(Tween::Type tween_type, + TransformAnimationCurveAdapter(gfx::Tween::Type tween_type, gfx::Transform intial_value, gfx::Transform target_value, base::TimeDelta duration); @@ -32,7 +32,7 @@ class COMPOSITOR_EXPORT TransformAnimationCurveAdapter gfx::BoxF* bounds) const OVERRIDE; private: - Tween::Type tween_type_; + gfx::Tween::Type tween_type_; gfx::Transform initial_value_; gfx::Transform target_value_; gfx::DecomposedTransform decomposed_initial_value_; diff --git a/ui/compositor/transform_animation_curve_adapter_unittest.cc b/ui/compositor/transform_animation_curve_adapter_unittest.cc index 5bef411..b68e862 100644 --- a/ui/compositor/transform_animation_curve_adapter_unittest.cc +++ b/ui/compositor/transform_animation_curve_adapter_unittest.cc @@ -30,7 +30,7 @@ TEST(InverseTransformCurveAdapterTest, InversesTransform) { const gfx::Transform effective_child_transform = parent_start * child_transform; - TransformAnimationCurveAdapter parent_curve(Tween::LINEAR, + TransformAnimationCurveAdapter parent_curve(gfx::Tween::LINEAR, parent_start, parent_target, duration); diff --git a/ui/base/animation/animation.cc b/ui/gfx/animation/animation.cc index 78ee4d9..ba0bac8 100644 --- a/ui/base/animation/animation.cc +++ b/ui/gfx/animation/animation.cc @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/animation.h" +#include "ui/gfx/animation/animation.h" -#include "ui/base/animation/animation_container.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/animation_container.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/tween.h" #include "ui/gfx/rect.h" #if defined(OS_WIN) #include "base/win/windows_version.h" #endif -namespace ui { +namespace gfx { Animation::Animation(base::TimeDelta timer_interval) : timer_interval_(timer_interval), @@ -121,4 +121,4 @@ base::TimeDelta Animation::GetTimerInterval() const { return timer_interval_; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/animation.h b/ui/gfx/animation/animation.h index 361ab15..fe5c554 100644 --- a/ui/base/animation/animation.h +++ b/ui/gfx/animation/animation.h @@ -8,13 +8,13 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" -#include "ui/base/animation/animation_container_element.h" +#include "ui/gfx/animation/animation_container_element.h" namespace gfx { class Rect; } -namespace ui { +namespace gfx { class AnimationContainer; class AnimationDelegate; @@ -25,7 +25,7 @@ class AnimationDelegate; // // To subclass override Step, which is invoked as the animation progresses and // GetCurrentValue() to return the value appropriate to the animation. -class UI_EXPORT Animation : public AnimationContainerElement { +class GFX_EXPORT Animation : public AnimationContainerElement { public: explicit Animation(base::TimeDelta timer_interval); virtual ~Animation(); @@ -104,6 +104,6 @@ class UI_EXPORT Animation : public AnimationContainerElement { DISALLOW_COPY_AND_ASSIGN(Animation); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_ANIMATION_H_ diff --git a/ui/base/animation/animation_container.cc b/ui/gfx/animation/animation_container.cc index c82d26b..c76f1bb 100644 --- a/ui/base/animation/animation_container.cc +++ b/ui/gfx/animation/animation_container.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/animation_container.h" +#include "ui/gfx/animation/animation_container.h" -#include "ui/base/animation/animation_container_element.h" -#include "ui/base/animation/animation_container_observer.h" +#include "ui/gfx/animation/animation_container_element.h" +#include "ui/gfx/animation/animation_container_observer.h" using base::TimeDelta; using base::TimeTicks; -namespace ui { +namespace gfx { AnimationContainer::AnimationContainer() : last_tick_time_(TimeTicks::Now()), @@ -101,4 +101,4 @@ TimeDelta AnimationContainer::GetMinInterval() { return min; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/animation_container.h b/ui/gfx/animation/animation_container.h index e1631f0..d7192b1 100644 --- a/ui/base/animation/animation_container.h +++ b/ui/gfx/animation/animation_container.h @@ -10,9 +10,9 @@ #include "base/memory/ref_counted.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" -namespace ui { +namespace gfx { class AnimationContainerElement; class AnimationContainerObserver; @@ -25,7 +25,7 @@ class AnimationContainerObserver; // // AnimationContainer is ref counted. Each Animation contained within the // AnimationContainer own it. -class UI_EXPORT AnimationContainer +class GFX_EXPORT AnimationContainer : public base::RefCounted<AnimationContainer> { public: AnimationContainer(); @@ -86,6 +86,6 @@ class UI_EXPORT AnimationContainer DISALLOW_COPY_AND_ASSIGN(AnimationContainer); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ diff --git a/ui/base/animation/animation_container_element.h b/ui/gfx/animation/animation_container_element.h index 1afa2b8..6d95fbb 100644 --- a/ui/base/animation/animation_container_element.h +++ b/ui/gfx/animation/animation_container_element.h @@ -6,13 +6,13 @@ #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_ELEMENT_H_ #include "base/time/time.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" -namespace ui { +namespace gfx { // Interface for the elements the AnimationContainer contains. This is // implemented by Animation. -class UI_EXPORT AnimationContainerElement { +class GFX_EXPORT AnimationContainerElement { public: // Sets the start of the animation. This is invoked from // AnimationContainer::Start. @@ -29,6 +29,6 @@ class UI_EXPORT AnimationContainerElement { virtual ~AnimationContainerElement() {} }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_ELEMENT_H_ diff --git a/ui/base/animation/animation_container_observer.h b/ui/gfx/animation/animation_container_observer.h index 06948ef..3183430 100644 --- a/ui/base/animation/animation_container_observer.h +++ b/ui/gfx/animation/animation_container_observer.h @@ -5,15 +5,15 @@ #ifndef UI_BASE_ANIMATION_ANIMATION_CONTAINER_OBSERVER_H_ #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_OBSERVER_H_ -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" -namespace ui { +namespace gfx { class AnimationContainer; // The observer is notified after every update of the animations managed by // the container. -class UI_EXPORT AnimationContainerObserver { +class GFX_EXPORT AnimationContainerObserver { public: // Invoked on every tick of the timer managed by the container and after // all the animations have updated. @@ -27,6 +27,6 @@ class UI_EXPORT AnimationContainerObserver { virtual ~AnimationContainerObserver() {} }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_OBSERVER_H_ diff --git a/ui/base/animation/animation_container_unittest.cc b/ui/gfx/animation/animation_container_unittest.cc index c516cf3..25977c2 100644 --- a/ui/base/animation/animation_container_unittest.cc +++ b/ui/gfx/animation/animation_container_unittest.cc @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ui/gfx/animation/animation_container.h" + #include "base/memory/scoped_ptr.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/animation/animation_container.h" -#include "ui/base/animation/animation_container_observer.h" -#include "ui/base/animation/linear_animation.h" -#include "ui/base/animation/test_animation_delegate.h" +#include "ui/gfx/animation/animation_container_observer.h" +#include "ui/gfx/animation/linear_animation.h" +#include "ui/gfx/animation/test_animation_delegate.h" using testing::AtLeast; -namespace ui { +namespace gfx { namespace { @@ -123,4 +124,4 @@ TEST_F(AnimationContainerTest, Observer) { container->set_observer(NULL); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/animation_delegate.h b/ui/gfx/animation/animation_delegate.h index 9a7edbc..d626353 100644 --- a/ui/base/animation/animation_delegate.h +++ b/ui/gfx/animation/animation_delegate.h @@ -5,9 +5,9 @@ #ifndef UI_BASE_ANIMATION_ANIMATION_DELEGATE_H_ #define UI_BASE_ANIMATION_ANIMATION_DELEGATE_H_ -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" -namespace ui { +namespace gfx { class Animation; @@ -15,7 +15,7 @@ class Animation; // // Implement this interface when you want to receive notifications about the // state of an animation. -class UI_EXPORT AnimationDelegate { +class GFX_EXPORT AnimationDelegate { public: // Called when an animation has completed. virtual void AnimationEnded(const Animation* animation) {} @@ -30,6 +30,6 @@ class UI_EXPORT AnimationDelegate { virtual ~AnimationDelegate() {} }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_ANIMATION_DELEGATE_H_ diff --git a/ui/base/animation/animation_unittest.cc b/ui/gfx/animation/animation_unittest.cc index 007f92d..00f1e26 100644 --- a/ui/base/animation/animation_unittest.cc +++ b/ui/gfx/animation/animation_unittest.cc @@ -3,15 +3,15 @@ // found in the LICENSE file. #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/linear_animation.h" -#include "ui/base/animation/test_animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/linear_animation.h" +#include "ui/gfx/animation/test_animation_delegate.h" #if defined(OS_WIN) #include "base/win/windows_version.h" #endif -namespace ui { +namespace gfx { class AnimationTest: public testing::Test { private: @@ -155,4 +155,4 @@ TEST_F(AnimationTest, StartState) { EXPECT_EQ(0.0, animation.GetCurrentValue()); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/linear_animation.cc b/ui/gfx/animation/linear_animation.cc index 33bd1d1..b3f3df0 100644 --- a/ui/base/animation/linear_animation.cc +++ b/ui/gfx/animation/linear_animation.cc @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/linear_animation.h" +#include "ui/gfx/animation/linear_animation.h" #include <math.h> -#include "ui/base/animation/animation_container.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_container.h" +#include "ui/gfx/animation/animation_delegate.h" using base::Time; using base::TimeDelta; -namespace ui { +namespace gfx { static TimeDelta CalculateInterval(int frame_rate) { int timer_interval = 1000000 / frame_rate; @@ -105,4 +105,4 @@ bool LinearAnimation::ShouldSendCanceledFromStop() { return state_ != 1; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/linear_animation.h b/ui/gfx/animation/linear_animation.h index 307a9fb..fe9d504 100644 --- a/ui/base/animation/linear_animation.h +++ b/ui/gfx/animation/linear_animation.h @@ -6,15 +6,15 @@ #define UI_BASE_ANIMATION_LINEAR_ANIMATION_H_ #include "base/time/time.h" -#include "ui/base/animation/animation.h" +#include "ui/gfx/animation/animation.h" -namespace ui { +namespace gfx { class AnimationDelegate; // Linear time bounded animation. As the animation progresses AnimateToState is // invoked. -class UI_EXPORT LinearAnimation : public Animation { +class GFX_EXPORT LinearAnimation : public Animation { public: // Initializes everything except the duration. // @@ -74,6 +74,6 @@ class UI_EXPORT LinearAnimation : public Animation { DISALLOW_COPY_AND_ASSIGN(LinearAnimation); }; -} // namespace ui +} // namespace gfx #endif // APP_LINEAR_ANIMATION_H_ diff --git a/ui/base/animation/multi_animation.cc b/ui/gfx/animation/multi_animation.cc index 2e9e477..4ecc73c 100644 --- a/ui/base/animation/multi_animation.cc +++ b/ui/gfx/animation/multi_animation.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/multi_animation.h" +#include "ui/gfx/animation/multi_animation.h" #include "base/logging.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" -namespace ui { +namespace gfx { // Default interval, in ms. static const int kDefaultTimerInterval = 20; @@ -91,4 +91,4 @@ const MultiAnimation::Part& MultiAnimation::GetPart(int* time_ms, return parts_[0]; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/multi_animation.h b/ui/gfx/animation/multi_animation.h index cbe36c4..8fd0542 100644 --- a/ui/base/animation/multi_animation.h +++ b/ui/gfx/animation/multi_animation.h @@ -7,16 +7,16 @@ #include <vector> -#include "ui/base/animation/animation.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/animation.h" +#include "ui/gfx/animation/tween.h" -namespace ui { +namespace gfx { // MultiAnimation is an animation that consists of a number of sub animations. // To create a MultiAnimation pass in the parts, invoke Start() and the delegate // is notified as the animation progresses. By default MultiAnimation runs until // Stop is invoked, see |set_continuous()| for details. -class UI_EXPORT MultiAnimation : public Animation { +class GFX_EXPORT MultiAnimation : public Animation { public: // Defines part of the animation. Each part consists of the following: // @@ -91,6 +91,6 @@ class UI_EXPORT MultiAnimation : public Animation { DISALLOW_COPY_AND_ASSIGN(MultiAnimation); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_MULTI_ANIMATION_H_ diff --git a/ui/base/animation/multi_animation_unittest.cc b/ui/gfx/animation/multi_animation_unittest.cc index 0c21939..b8a11fd 100644 --- a/ui/base/animation/multi_animation_unittest.cc +++ b/ui/gfx/animation/multi_animation_unittest.cc @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ui/gfx/animation/multi_animation.h" + #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/animation/animation_container_element.h" -#include "ui/base/animation/multi_animation.h" +#include "ui/gfx/animation/animation_container_element.h" -namespace ui { +namespace gfx { TEST(MultiAnimationTest, Basic) { // Create a MultiAnimation with two parts. @@ -88,4 +89,4 @@ TEST(MultiAnimationTest, Cycle) { EXPECT_EQ(.5, animation.GetCurrentValue()); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/slide_animation.cc b/ui/gfx/animation/slide_animation.cc index e73474c..d08ac41 100644 --- a/ui/base/animation/slide_animation.cc +++ b/ui/gfx/animation/slide_animation.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" #include <math.h> -namespace ui { +namespace gfx { // How many frames per second to target. static const int kDefaultFrameRateHz = 60; @@ -111,4 +111,4 @@ void SlideAnimation::AnimateToState(double state) { } } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/slide_animation.h b/ui/gfx/animation/slide_animation.h index 709633b..2fc30ae 100644 --- a/ui/base/animation/slide_animation.h +++ b/ui/gfx/animation/slide_animation.h @@ -5,16 +5,16 @@ #ifndef UI_BASE_ANIMATION_SLIDE_ANIMATION_H_ #define UI_BASE_ANIMATION_SLIDE_ANIMATION_H_ -#include "ui/base/animation/linear_animation.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/linear_animation.h" +#include "ui/gfx/animation/tween.h" -namespace ui { +namespace gfx { // Slide Animation // // Used for reversible animations and as a general helper class. Typical usage: // -// #include "ui/base/animation/slide_animation.h" +// #include "ui/gfx/animation/slide_animation.h" // // class MyClass : public AnimationDelegate { // public: @@ -44,7 +44,7 @@ namespace ui { // private: // scoped_ptr<SlideAnimation> animation_; // } -class UI_EXPORT SlideAnimation : public LinearAnimation { +class GFX_EXPORT SlideAnimation : public LinearAnimation { public: explicit SlideAnimation(AnimationDelegate* target); virtual ~SlideAnimation(); @@ -96,6 +96,6 @@ class UI_EXPORT SlideAnimation : public LinearAnimation { DISALLOW_COPY_AND_ASSIGN(SlideAnimation); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_SLIDE_ANIMATION_H_ diff --git a/ui/base/animation/slide_animation_unittest.cc b/ui/gfx/animation/slide_animation_unittest.cc index afd32b7..9d4f534 100644 --- a/ui/base/animation/slide_animation_unittest.cc +++ b/ui/gfx/animation/slide_animation_unittest.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ui/gfx/animation/slide_animation.h" + #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/animation/slide_animation.h" -#include "ui/base/animation/test_animation_delegate.h" +#include "ui/gfx/animation/test_animation_delegate.h" -namespace ui { +namespace gfx { // Class to provide access to SlideAnimation internals for testing. class SlideAnimation::TestApi { @@ -101,4 +102,4 @@ TEST_F(SlideAnimationTest, DontNotifyOnDelete) { EXPECT_FALSE(delegate.canceled()); } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/test_animation_delegate.h b/ui/gfx/animation/test_animation_delegate.h index 3cdaf8c..bb46496 100644 --- a/ui/base/animation/test_animation_delegate.h +++ b/ui/gfx/animation/test_animation_delegate.h @@ -6,9 +6,9 @@ #define UI_BASE_ANIMATION_TEST_ANIMATION_DELEGATE_H_ #include "base/message_loop/message_loop.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" -namespace ui { +namespace gfx { // Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the // message loop. @@ -43,6 +43,6 @@ class TestAnimationDelegate : public AnimationDelegate { DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_TEST_ANIMATION_DELEGATE_H_ diff --git a/ui/base/animation/throb_animation.cc b/ui/gfx/animation/throb_animation.cc index 72392a0..0a88aa7 100644 --- a/ui/base/animation/throb_animation.cc +++ b/ui/gfx/animation/throb_animation.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/throb_animation.h" +#include "ui/gfx/animation/throb_animation.h" #include <limits> -namespace ui { +namespace gfx { static const int kDefaultThrobDurationMS = 400; @@ -82,4 +82,4 @@ void ThrobAnimation::ResetForSlide() { throbbing_ = false; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/throb_animation.h b/ui/gfx/animation/throb_animation.h index 4292eee..1d14725 100644 --- a/ui/base/animation/throb_animation.h +++ b/ui/gfx/animation/throb_animation.h @@ -5,9 +5,9 @@ #ifndef UI_BASE_ANIMATION_THROB_ANIMATION_H_ #define UI_BASE_ANIMATION_THROB_ANIMATION_H_ -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" -namespace ui { +namespace gfx { // A subclass of SlideAnimation that can continually slide. All of the Animation // methods behave like that of SlideAnimation: transition to the next state. @@ -16,7 +16,7 @@ namespace ui { // // A ThrobAnimation has two durations: the duration used when behavior like // a SlideAnimation, and the duration used when throbbing. -class UI_EXPORT ThrobAnimation : public SlideAnimation { +class GFX_EXPORT ThrobAnimation : public SlideAnimation { public: explicit ThrobAnimation(AnimationDelegate* target); virtual ~ThrobAnimation() {} @@ -64,6 +64,6 @@ class UI_EXPORT ThrobAnimation : public SlideAnimation { DISALLOW_COPY_AND_ASSIGN(ThrobAnimation); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_THROB_ANIMATION_H_ diff --git a/ui/base/animation/tween.cc b/ui/gfx/animation/tween.cc index ac6fa26..4d1a6b3b 100644 --- a/ui/base/animation/tween.cc +++ b/ui/gfx/animation/tween.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/tween.h" #include <math.h> @@ -12,7 +12,7 @@ #include "base/logging.h" -namespace ui { +namespace gfx { // static double Tween::CalculateValue(Tween::Type type, double state) { @@ -103,4 +103,4 @@ gfx::Transform Tween::ValueBetween(double value, return to_return; } -} // namespace ui +} // namespace gfx diff --git a/ui/base/animation/tween.h b/ui/gfx/animation/tween.h index 6e2f179..020fa6a 100644 --- a/ui/base/animation/tween.h +++ b/ui/gfx/animation/tween.h @@ -6,13 +6,13 @@ #define UI_BASE_ANIMATION_TWEEN_H_ #include "base/basictypes.h" -#include "ui/base/ui_export.h" +#include "ui/gfx/gfx_export.h" #include "ui/gfx/rect.h" #include "ui/gfx/transform.h" -namespace ui { +namespace gfx { -class UI_EXPORT Tween { +class GFX_EXPORT Tween { public: enum Type { LINEAR, // Linear. @@ -46,6 +46,6 @@ class UI_EXPORT Tween { DISALLOW_COPY_AND_ASSIGN(Tween); }; -} // namespace ui +} // namespace gfx #endif // UI_BASE_ANIMATION_TWEEN_H_ diff --git a/ui/gfx/gfx_export.h b/ui/gfx/gfx_export.h index d99a9956..f610d98 100644 --- a/ui/gfx/gfx_export.h +++ b/ui/gfx/gfx_export.h @@ -5,9 +5,29 @@ #ifndef UI_GFX_GFX_EXPORT_H_ #define UI_GFX_GFX_EXPORT_H_ -// TODO(beng): put in normal export #defines once gfx dependencies have been -// corrected. +// TODO(beng): remove include once gfx dependencies have been corrected. #include "ui/base/ui_export.h" +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(UI_IMPLEMENTATION) +#define GFX_EXPORT __declspec(dllexport) +#else +#define GFX_EXPORT __declspec(dllimport) +#endif // defined(UI_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(UI_IMPLEMENTATION) +#define GFX_EXPORT __attribute__((visibility("default"))) +#else +#define GFX_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define GFX_EXPORT +#endif + #endif // UI_GFX_GFX_EXPORT_H_ diff --git a/ui/gfx/interpolated_transform.cc b/ui/gfx/interpolated_transform.cc index 583c27f..b9698b1 100644 --- a/ui/gfx/interpolated_transform.cc +++ b/ui/gfx/interpolated_transform.cc @@ -11,7 +11,7 @@ #endif #include "base/logging.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/tween.h" namespace { @@ -125,7 +125,8 @@ inline float InterpolatedTransform::ValueBetween(float time, return end_value; float t = (time - start_time_) / (end_time_ - start_time_); - return static_cast<float>(Tween::ValueBetween(t, start_value, end_value)); + return static_cast<float>( + gfx::Tween::ValueBetween(t, start_value, end_value)); } /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc index 4d68754..2acece7 100644 --- a/ui/message_center/views/message_center_view.cc +++ b/ui/message_center/views/message_center_view.cc @@ -11,9 +11,9 @@ #include "base/message_loop/message_loop.h" #include "base/stl_util.h" #include "grit/ui_strings.h" -#include "ui/base/animation/multi_animation.h" -#include "ui/base/animation/slide_animation.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/animation/multi_animation.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/insets.h" #include "ui/gfx/rect.h" @@ -416,7 +416,7 @@ void MessageListView::OnBoundsAnimatorProgressed( DCHECK_EQ(animator_.get(), animator); for (std::set<views::View*>::iterator iter = deleted_when_done_.begin(); iter != deleted_when_done_.end(); ++iter) { - const ui::SlideAnimation* animation = animator->GetAnimationForView(*iter); + const gfx::SlideAnimation* animation = animator->GetAnimationForView(*iter); if (animation) (*iter)->layer()->SetOpacity(animation->CurrentValueBetween(1.0, 0.0)); } @@ -684,28 +684,28 @@ void MessageCenterView::SetSettingsVisible(bool visible) { source_height_ = source_view_->GetHeightForWidth(width()); target_height_ = target_view_->GetHeightForWidth(width()); - ui::MultiAnimation::Parts parts; + gfx::MultiAnimation::Parts parts; // First part: slide resize animation. - parts.push_back(ui::MultiAnimation::Part( + parts.push_back(gfx::MultiAnimation::Part( (source_height_ == target_height_) ? 0 : kDefaultAnimationDurationMs, - ui::Tween::EASE_OUT)); + gfx::Tween::EASE_OUT)); // Second part: fade-out the source_view. if (source_view_->layer()) { - parts.push_back(ui::MultiAnimation::Part( - kDefaultAnimationDurationMs, ui::Tween::LINEAR)); + parts.push_back(gfx::MultiAnimation::Part( + kDefaultAnimationDurationMs, gfx::Tween::LINEAR)); } else { - parts.push_back(ui::MultiAnimation::Part()); + parts.push_back(gfx::MultiAnimation::Part()); } // Third part: fade-in the target_view. if (target_view_->layer()) { - parts.push_back(ui::MultiAnimation::Part( - kDefaultAnimationDurationMs, ui::Tween::LINEAR)); + parts.push_back(gfx::MultiAnimation::Part( + kDefaultAnimationDurationMs, gfx::Tween::LINEAR)); target_view_->layer()->SetOpacity(0); target_view_->SetVisible(true); } else { - parts.push_back(ui::MultiAnimation::Part()); + parts.push_back(gfx::MultiAnimation::Part()); } - settings_transition_animation_.reset(new ui::MultiAnimation( + settings_transition_animation_.reset(new gfx::MultiAnimation( parts, base::TimeDelta::FromMicroseconds(1000000 / kDefaultFrameRateHz))); settings_transition_animation_->set_delegate(this); settings_transition_animation_->set_continuous(false); @@ -932,7 +932,7 @@ void MessageCenterView::OnNotificationUpdated(const std::string& id) { } } -void MessageCenterView::AnimationEnded(const ui::Animation* animation) { +void MessageCenterView::AnimationEnded(const gfx::Animation* animation) { DCHECK_EQ(animation, settings_transition_animation_.get()); Visibility visibility = target_view_ == settings_view_ @@ -951,7 +951,7 @@ void MessageCenterView::AnimationEnded(const ui::Animation* animation) { Layout(); } -void MessageCenterView::AnimationProgressed(const ui::Animation* animation) { +void MessageCenterView::AnimationProgressed(const gfx::Animation* animation) { DCHECK_EQ(animation, settings_transition_animation_.get()); PreferredSizeChanged(); if (settings_transition_animation_->current_part_index() == 1 && @@ -967,7 +967,7 @@ void MessageCenterView::AnimationProgressed(const ui::Animation* animation) { } } -void MessageCenterView::AnimationCanceled(const ui::Animation* animation) { +void MessageCenterView::AnimationCanceled(const gfx::Animation* animation) { DCHECK_EQ(animation, settings_transition_animation_.get()); AnimationEnded(animation); } diff --git a/ui/message_center/views/message_center_view.h b/ui/message_center/views/message_center_view.h index d53910c..7e3c829 100644 --- a/ui/message_center/views/message_center_view.h +++ b/ui/message_center/views/message_center_view.h @@ -7,15 +7,15 @@ #include "ui/views/view.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/message_center/message_center_export.h" #include "ui/message_center/message_center_observer.h" #include "ui/message_center/notification_list.h" #include "ui/views/controls/button/button.h" -namespace ui { +namespace gfx { class MultiAnimation; -} // namespace ui +} // namespace gfx namespace views { class Button; @@ -37,7 +37,7 @@ class NotifierSettingsView; class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View, public MessageCenterObserver, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: MessageCenterView(MessageCenter* message_center, MessageCenterTray* tray, @@ -73,10 +73,10 @@ class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View, bool by_user) OVERRIDE; virtual void OnNotificationUpdated(const std::string& id) OVERRIDE; - // 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; private: friend class MessageCenterViewTest; @@ -102,7 +102,7 @@ class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View, // Animation managing transition between message center and settings (and vice // versa). - scoped_ptr<ui::MultiAnimation> settings_transition_animation_; + scoped_ptr<gfx::MultiAnimation> settings_transition_animation_; // Helper data to keep track of the transition between settings and // message center views. diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc index 71b07f4..b82460d 100644 --- a/ui/message_center/views/message_popup_collection.cc +++ b/ui/message_center/views/message_popup_collection.cc @@ -14,8 +14,8 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/base/accessibility/accessibility_types.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" #include "ui/gfx/screen.h" #include "ui/message_center/message_center.h" #include "ui/message_center/message_center_style.h" diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc index 93cd953..645c654 100644 --- a/ui/message_center/views/toast_contents_view.cc +++ b/ui/message_center/views/toast_contents_view.cc @@ -11,8 +11,8 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/base/accessibility/accessible_view_state.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" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/message_center/message_center.h" @@ -59,7 +59,7 @@ ToastContentsView::ToastContentsView( // remains. This is hacky but easier to keep the consistency. set_background(views::Background::CreateSolidBackground(0, 0, 0, 0)); - fade_animation_.reset(new ui::SlideAnimation(this)); + fade_animation_.reset(new gfx::SlideAnimation(this)); fade_animation_->SetSlideDuration(kFadeInOutDuration); } @@ -167,7 +167,7 @@ void ToastContentsView::SetBoundsWithAnimation(gfx::Rect new_bounds) { if (bounds_animation_.get()) bounds_animation_->Stop(); - bounds_animation_.reset(new ui::SlideAnimation(this)); + bounds_animation_.reset(new gfx::SlideAnimation(this)); bounds_animation_->Show(); } @@ -195,7 +195,7 @@ void ToastContentsView::StartFadeOut() { } void ToastContentsView::OnBoundsAnimationEndedOrCancelled( - const ui::Animation* animation) { + const gfx::Animation* animation) { if (is_closing_ && closing_animation_ == animation && GetWidget()) { views::Widget* widget = GetWidget(); #if defined(USE_AURA) @@ -219,8 +219,8 @@ void ToastContentsView::OnBoundsAnimationEndedOrCancelled( collection_->DecrementDeferCounter(); } -// ui::AnimationDelegate -void ToastContentsView::AnimationProgressed(const ui::Animation* animation) { +// gfx::AnimationDelegate +void ToastContentsView::AnimationProgressed(const gfx::Animation* animation) { if (animation == bounds_animation_.get()) { gfx::Rect current(animation->CurrentValueBetween( animated_bounds_start_, animated_bounds_end_)); @@ -232,12 +232,12 @@ void ToastContentsView::AnimationProgressed(const ui::Animation* animation) { } } -void ToastContentsView::AnimationEnded(const ui::Animation* animation) { +void ToastContentsView::AnimationEnded(const gfx::Animation* animation) { OnBoundsAnimationEndedOrCancelled(animation); } void ToastContentsView::AnimationCanceled( - const ui::Animation* animation) { + const gfx::Animation* animation) { OnBoundsAnimationEndedOrCancelled(animation); } diff --git a/ui/message_center/views/toast_contents_view.h b/ui/message_center/views/toast_contents_view.h index 4f26c6a..6b79ac1 100644 --- a/ui/message_center/views/toast_contents_view.h +++ b/ui/message_center/views/toast_contents_view.h @@ -7,14 +7,14 @@ #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" #include "ui/views/widget/widget_delegate.h" -namespace ui { +namespace gfx { class Animation; class SlideAnimation; } @@ -32,7 +32,7 @@ class Notification; class ToastContentsView : public views::WidgetDelegateView, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: ToastContentsView(const Notification* notification, base::WeakPtr<MessagePopupCollection> collection, @@ -71,10 +71,10 @@ class ToastContentsView : public views::WidgetDelegateView, virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; private: - // 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; // Overridden from views::WidgetDelegate: virtual views::View* GetContentsView() OVERRIDE; @@ -90,7 +90,7 @@ class ToastContentsView : public views::WidgetDelegateView, void StartFadeIn(); void StartFadeOut(); // Will call Widget::Close() when animation ends. - void OnBoundsAnimationEndedOrCancelled(const ui::Animation* animation); + void OnBoundsAnimationEndedOrCancelled(const gfx::Animation* animation); base::WeakPtr<MessagePopupCollection> collection_; MessageCenter* message_center_; @@ -98,8 +98,8 @@ class ToastContentsView : public views::WidgetDelegateView, // Id if the corresponding Notification. std::string id_; - scoped_ptr<ui::SlideAnimation> bounds_animation_; - scoped_ptr<ui::SlideAnimation> fade_animation_; + scoped_ptr<gfx::SlideAnimation> bounds_animation_; + scoped_ptr<gfx::SlideAnimation> fade_animation_; bool is_animating_bounds_; gfx::Rect animated_bounds_start_; @@ -108,7 +108,7 @@ class ToastContentsView : public views::WidgetDelegateView, bool is_closing_; // Closing animation - when it ends, close the widget. Weak, only used // for referential equality. - ui::Animation* closing_animation_; + gfx::Animation* closing_animation_; gfx::Point origin_; gfx::Size preferred_size_; @@ -31,6 +31,8 @@ 'ui_resources', ], 'defines': [ + # TODO(sky): remove once gfx dependencies are corrected. + 'GFX_IMPLEMENTATION', 'UI_IMPLEMENTATION', ], # Export these dependencies since text_elider.h includes ICU headers. @@ -62,23 +64,6 @@ 'base/accessibility/accessible_text_utils.h', 'base/accessibility/accessible_view_state.cc', 'base/accessibility/accessible_view_state.h', - 'base/animation/animation.cc', - 'base/animation/animation.h', - 'base/animation/animation_container.cc', - 'base/animation/animation_container.h', - 'base/animation/animation_container_element.h', - 'base/animation/animation_container_observer.h', - 'base/animation/animation_delegate.h', - 'base/animation/linear_animation.cc', - 'base/animation/linear_animation.h', - 'base/animation/multi_animation.cc', - 'base/animation/multi_animation.h', - 'base/animation/slide_animation.cc', - 'base/animation/slide_animation.h', - 'base/animation/throb_animation.cc', - 'base/animation/throb_animation.h', - 'base/animation/tween.cc', - 'base/animation/tween.h', 'base/base_window.cc', 'base/base_window.h', 'base/clipboard/clipboard.cc', @@ -395,6 +380,23 @@ 'gfx/android/device_display_info.h', 'gfx/android/java_bitmap.cc', 'gfx/android/java_bitmap.h', + 'gfx/animation/animation.cc', + 'gfx/animation/animation.h', + 'gfx/animation/animation_container.cc', + 'gfx/animation/animation_container.h', + 'gfx/animation/animation_container_element.h', + 'gfx/animation/animation_container_observer.h', + 'gfx/animation/animation_delegate.h', + 'gfx/animation/linear_animation.cc', + 'gfx/animation/linear_animation.h', + 'gfx/animation/multi_animation.cc', + 'gfx/animation/multi_animation.h', + 'gfx/animation/slide_animation.cc', + 'gfx/animation/slide_animation.h', + 'gfx/animation/throb_animation.cc', + 'gfx/animation/throb_animation.h', + 'gfx/animation/tween.cc', + 'gfx/animation/tween.h', 'gfx/blit.cc', 'gfx/blit.h', 'gfx/box_f.cc', @@ -627,9 +629,9 @@ ['include', '_ios\\.(cc|mm)$'], ['include', '(^|/)ios/'], ['include', '^gfx/'], + ['include', '^gfx/animation/'], ['exclude', '^gfx/codec/jpeg_codec\\.cc$'], ['include', '^gfx/range/'], - ['include', '^base/animation/'], ['include', '^base/l10n/'], ['include', '^base/layout'], ['include', '^base/resource/'], @@ -891,7 +893,6 @@ 'sources!': [ 'base/accessibility/accessible_text_utils.cc', 'base/accessibility/accessible_view_state.cc', - 'base/animation/throb_animation.cc', 'base/default_theme_provider.cc', 'base/dragdrop/drag_utils.cc', 'base/dragdrop/drag_utils.h', @@ -904,6 +905,7 @@ 'base/touch/touch_device.cc', 'base/touch/touch_editing_controller.cc', 'base/ui_base_types.cc', + 'gfx/animation/throb_animation.cc', 'gfx/display_observer.cc', 'gfx/path.cc', 'gfx/selection_model.cc', diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi index 6d7315f..634bc31 100644 --- a/ui/ui_unittests.gypi +++ b/ui/ui_unittests.gypi @@ -91,10 +91,6 @@ # iOS uses a small subset of ui. common_sources are the only files that # are built on iOS. 'common_sources' : [ - 'base/animation/animation_container_unittest.cc', - 'base/animation/animation_unittest.cc', - 'base/animation/multi_animation_unittest.cc', - 'base/animation/slide_animation_unittest.cc', 'base/layout_unittest.cc', 'base/l10n/l10n_util_mac_unittest.mm', 'base/l10n/l10n_util_unittest.cc', @@ -104,6 +100,10 @@ 'base/resource/data_pack_literal.cc', 'base/resource/data_pack_unittest.cc', 'base/resource/resource_bundle_unittest.cc', + 'gfx/animation/animation_container_unittest.cc', + 'gfx/animation/animation_unittest.cc', + 'gfx/animation/multi_animation_unittest.cc', + 'gfx/animation/slide_animation_unittest.cc', 'gfx/box_unittest.cc', 'gfx/codec/png_codec_unittest.cc', 'gfx/color_utils_unittest.cc', diff --git a/ui/views/animation/bounds_animator.cc b/ui/views/animation/bounds_animator.cc index c064cc8..839294f 100644 --- a/ui/views/animation/bounds_animator.cc +++ b/ui/views/animation/bounds_animator.cc @@ -5,18 +5,18 @@ #include "ui/views/animation/bounds_animator.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/animation/animation_container.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/animation_container.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/views/animation/bounds_animator_observer.h" #include "ui/views/view.h" // Duration in milliseconds for animations. static const int kDefaultAnimationDuration = 200; -using ui::Animation; -using ui::AnimationContainer; -using ui::SlideAnimation; -using ui::Tween; +using gfx::Animation; +using gfx::AnimationContainer; +using gfx::SlideAnimation; +using gfx::Tween; namespace views { diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h index 4082b5c..1688dd5 100644 --- a/ui/views/animation/bounds_animator.h +++ b/ui/views/animation/bounds_animator.h @@ -10,13 +10,13 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h" -#include "ui/base/animation/animation_container_observer.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/base/animation/tween.h" +#include "ui/gfx/animation/animation_container_observer.h" +#include "ui/gfx/animation/animation_delegate.h" +#include "ui/gfx/animation/tween.h" #include "ui/gfx/rect.h" #include "ui/views/views_export.h" -namespace ui { +namespace gfx { class SlideAnimation; } @@ -35,12 +35,12 @@ class View; // You can attach an AnimationDelegate to the individual animation for a view // by way of SetAnimationDelegate. Additionally you can attach an observer to // the BoundsAnimator that is notified when all animations are complete. -class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, - public ui::AnimationContainerObserver { +class VIEWS_EXPORT BoundsAnimator : public gfx::AnimationDelegate, + public gfx::AnimationContainerObserver { public: // If |delete_when_done| is set to true in |SetAnimationDelegate| the // |AnimationDelegate| must subclass this class. - class OwnedAnimationDelegate : public ui::AnimationDelegate { + class OwnedAnimationDelegate : public gfx::AnimationDelegate { public: virtual ~OwnedAnimationDelegate() {} }; @@ -65,11 +65,11 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // Sets the animation for the specified view. BoundsAnimator takes ownership // of the specified animation. - void SetAnimationForView(View* view, ui::SlideAnimation* animation); + void SetAnimationForView(View* view, gfx::SlideAnimation* animation); // Returns the animation for the specified view. BoundsAnimator owns the // returned Animation. - const ui::SlideAnimation* GetAnimationForView(View* view); + const gfx::SlideAnimation* GetAnimationForView(View* view); // Stops animating the specified view. void StopAnimatingView(View* view); @@ -78,7 +78,7 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // |delete_when_done| is true the |delegate| is deleted when done and // |delegate| must subclass OwnedAnimationDelegate. void SetAnimationDelegate(View* view, - ui::AnimationDelegate* delegate, + gfx::AnimationDelegate* delegate, bool delete_when_done); // Returns true if BoundsAnimator is animating the bounds of |view|. @@ -96,14 +96,14 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, void SetAnimationDuration(int duration_ms); // Sets the tween type for new animations. Default is EASE_OUT. - void set_tween_type(ui::Tween::Type type) { tween_type_ = type; } + void set_tween_type(gfx::Tween::Type type) { tween_type_ = type; } void AddObserver(BoundsAnimatorObserver* observer); void RemoveObserver(BoundsAnimatorObserver* observer); protected: // Creates the animation to use for animating views. - virtual ui::SlideAnimation* CreateAnimation(); + virtual gfx::SlideAnimation* CreateAnimation(); private: // Tracks data about the view being animated. @@ -123,10 +123,10 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, gfx::Rect target_bounds; // The animation. We own this. - ui::SlideAnimation* animation; + gfx::SlideAnimation* animation; // Additional delegate for the animation, may be null. - ui::AnimationDelegate* delegate; + gfx::AnimationDelegate* delegate; }; // Used by AnimationEndedOrCanceled. @@ -137,7 +137,7 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, typedef std::map<View*, Data> ViewToDataMap; - typedef std::map<const ui::Animation*, View*> AnimationToViewMap; + typedef std::map<const gfx::Animation*, View*> AnimationToViewMap; // Removes references to |view| and its animation. This does NOT delete the // animation or delegate. @@ -150,22 +150,22 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // Used when changing the animation for a view. This resets the maps for // the animation used by view and returns the current animation. Ownership // of the returned animation passes to the caller. - ui::Animation* ResetAnimationForView(View* view); + gfx::Animation* ResetAnimationForView(View* view); // Invoked from AnimationEnded and AnimationCanceled. - void AnimationEndedOrCanceled(const ui::Animation* animation, + void AnimationEndedOrCanceled(const gfx::Animation* animation, AnimationEndType type); - // ui::AnimationDelegate overrides. - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides. + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; - // ui::AnimationContainerObserver overrides. + // gfx::AnimationContainerObserver overrides. virtual void AnimationContainerProgressed( - ui::AnimationContainer* container) OVERRIDE; + gfx::AnimationContainer* container) OVERRIDE; virtual void AnimationContainerEmpty( - ui::AnimationContainer* container) OVERRIDE; + gfx::AnimationContainer* container) OVERRIDE; // Parent of all views being animated. View* parent_; @@ -173,7 +173,7 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, ObserverList<BoundsAnimatorObserver> observers_; // All animations we create up with the same container. - scoped_refptr<ui::AnimationContainer> container_; + scoped_refptr<gfx::AnimationContainer> container_; // Maps from view being animated to info about the view. ViewToDataMap data_; @@ -189,7 +189,7 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, int animation_duration_ms_; - ui::Tween::Type tween_type_; + gfx::Tween::Type tween_type_; DISALLOW_COPY_AND_ASSIGN(BoundsAnimator); }; diff --git a/ui/views/animation/bounds_animator_unittest.cc b/ui/views/animation/bounds_animator_unittest.cc index ed7dca5..0928fe6 100644 --- a/ui/views/animation/bounds_animator_unittest.cc +++ b/ui/views/animation/bounds_animator_unittest.cc @@ -5,13 +5,13 @@ #include "ui/views/animation/bounds_animator.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/animation/slide_animation.h" -#include "ui/base/animation/test_animation_delegate.h" +#include "ui/gfx/animation/slide_animation.h" +#include "ui/gfx/animation/test_animation_delegate.h" #include "ui/views/view.h" -using ui::Animation; -using ui::SlideAnimation; -using ui::TestAnimationDelegate; +using gfx::Animation; +using gfx::SlideAnimation; +using gfx::TestAnimationDelegate; namespace views { namespace { @@ -52,7 +52,7 @@ class OwnedDelegate : public BoundsAnimator::OwnedAnimationDelegate { return value; } - // Overridden from ui::AnimationDelegate: + // Overridden from gfx::AnimationDelegate: virtual void AnimationCanceled(const Animation* animation) OVERRIDE { canceled_ = true; } diff --git a/ui/views/animation/scroll_animator.cc b/ui/views/animation/scroll_animator.cc index 1e484a3..7d68999 100644 --- a/ui/views/animation/scroll_animator.cc +++ b/ui/views/animation/scroll_animator.cc @@ -8,7 +8,7 @@ #include <cmath> #include "base/logging.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" namespace { const float kDefaultAcceleration = -1500.0f; // in pixels per second^2 @@ -51,7 +51,7 @@ void ScrollAnimator::Start(float velocity_x, float velocity_y) { velocity_x_ = velocity_x; velocity_y_ = velocity_y; duration_ = -v / acceleration_; // in seconds - animation_.reset(new ui::SlideAnimation(this)); + animation_.reset(new gfx::SlideAnimation(this)); animation_->SetSlideDuration(static_cast<int>(duration_ * 1000)); animation_->Show(); } @@ -61,11 +61,11 @@ void ScrollAnimator::Stop() { animation_.reset(); } -void ScrollAnimator::AnimationEnded(const ui::Animation* animation) { +void ScrollAnimator::AnimationEnded(const gfx::Animation* animation) { Stop(); } -void ScrollAnimator::AnimationProgressed(const ui::Animation* animation) { +void ScrollAnimator::AnimationProgressed(const gfx::Animation* animation) { float t = static_cast<float>(animation->GetCurrentValue()) * duration_; float a_x = velocity_x_ > 0 ? acceleration_ : -acceleration_; float a_y = velocity_y_ > 0 ? acceleration_ : -acceleration_; @@ -75,7 +75,7 @@ void ScrollAnimator::AnimationProgressed(const ui::Animation* animation) { delegate_->OnScroll(dx, dy); } -void ScrollAnimator::AnimationCanceled(const ui::Animation* animation) { +void ScrollAnimator::AnimationCanceled(const gfx::Animation* animation) { Stop(); } diff --git a/ui/views/animation/scroll_animator.h b/ui/views/animation/scroll_animator.h index 35e159b..525a998 100644 --- a/ui/views/animation/scroll_animator.h +++ b/ui/views/animation/scroll_animator.h @@ -7,10 +7,10 @@ #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/views/views_export.h" -namespace ui { +namespace gfx { class SlideAnimation; } @@ -25,7 +25,7 @@ class VIEWS_EXPORT ScrollDelegate { ~ScrollDelegate() {} }; -class VIEWS_EXPORT ScrollAnimator : public ui::AnimationDelegate { +class VIEWS_EXPORT ScrollAnimator : public gfx::AnimationDelegate { public: // The ScrollAnimator does not own the delegate. Uses default acceleration. explicit ScrollAnimator(ScrollDelegate* delegate); @@ -40,10 +40,10 @@ class VIEWS_EXPORT ScrollAnimator : public ui::AnimationDelegate { bool is_scrolling() const { return !!animation_.get(); } private: - // Implementation of 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; + // Implementation of 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; ScrollDelegate* delegate_; @@ -53,7 +53,7 @@ class VIEWS_EXPORT ScrollAnimator : public ui::AnimationDelegate { float duration_; float acceleration_; - scoped_ptr<ui::SlideAnimation> animation_; + scoped_ptr<gfx::SlideAnimation> animation_; DISALLOW_COPY_AND_ASSIGN(ScrollAnimator); }; diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc index 5eb9943..335cd9b 100644 --- a/ui/views/bubble/bubble_delegate.cc +++ b/ui/views/bubble/bubble_delegate.cc @@ -4,7 +4,7 @@ #include "ui/views/bubble/bubble_delegate.h" -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/rect.h" #include "ui/native_theme/native_theme.h" @@ -270,7 +270,7 @@ void BubbleDelegateView::StartFade(bool fade_in) { else GetWidget()->Close(); #else - fade_animation_.reset(new ui::SlideAnimation(this)); + fade_animation_.reset(new gfx::SlideAnimation(this)); fade_animation_->SetSlideDuration(GetFadeDuration()); fade_animation_->Reset(fade_in ? 0.0 : 1.0); if (fade_in) { @@ -323,7 +323,7 @@ void BubbleDelegateView::OnNativeThemeChanged(const ui::NativeTheme* theme) { UpdateColorsFromTheme(theme); } -void BubbleDelegateView::AnimationEnded(const ui::Animation* animation) { +void BubbleDelegateView::AnimationEnded(const gfx::Animation* animation) { if (animation != fade_animation_.get()) return; bool closed = fade_animation_->GetCurrentValue() == 0; @@ -332,7 +332,7 @@ void BubbleDelegateView::AnimationEnded(const ui::Animation* animation) { GetWidget()->Close(); } -void BubbleDelegateView::AnimationProgressed(const ui::Animation* animation) { +void BubbleDelegateView::AnimationProgressed(const gfx::Animation* animation) { if (animation != fade_animation_.get()) return; DCHECK(fade_animation_->is_animating()); diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h index dff9bd4..3336c6d 100644 --- a/ui/views/bubble/bubble_delegate.h +++ b/ui/views/bubble/bubble_delegate.h @@ -6,16 +6,13 @@ #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ #include "base/gtest_prod_util.h" -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h" namespace gfx { class Rect; -} - -namespace ui { class SlideAnimation; } @@ -28,7 +25,7 @@ class BubbleFrameView; // /////////////////////////////////////////////////////////////////////////////// class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, - public ui::AnimationDelegate, + public gfx::AnimationDelegate, public WidgetObserver { public: BubbleDelegateView(); @@ -136,9 +133,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; - // ui::AnimationDelegate overrides: - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; // Perform view initialization on the contents for bubble sizing. virtual void Init(); @@ -168,7 +165,7 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, void HandleVisibilityChanged(Widget* widget, bool visible); // Fade animation for bubble. - scoped_ptr<ui::SlideAnimation> fade_animation_; + scoped_ptr<gfx::SlideAnimation> fade_animation_; // Flags controlling bubble closure on the escape key and deactivation. bool close_on_esc_; diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc index f8e8b58..17ea8df 100644 --- a/ui/views/controls/button/custom_button.cc +++ b/ui/views/controls/button/custom_button.cc @@ -5,9 +5,9 @@ #include "ui/views/controls/button/custom_button.h" #include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/events/event.h" #include "ui/base/keycodes/keyboard_codes.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -277,9 +277,9 @@ void CustomButton::VisibilityChanged(View* starting_from, bool visible) { } //////////////////////////////////////////////////////////////////////////////// -// CustomButton, ui::AnimationDelegate implementation: +// CustomButton, gfx::AnimationDelegate implementation: -void CustomButton::AnimationProgressed(const ui::Animation* animation) { +void CustomButton::AnimationProgressed(const gfx::Animation* animation) { SchedulePaint(); } @@ -293,7 +293,7 @@ CustomButton::CustomButton(ButtonListener* listener) is_throbbing_(false), triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), request_focus_on_press_(true) { - hover_animation_.reset(new ui::ThrobAnimation(this)); + hover_animation_.reset(new gfx::ThrobAnimation(this)); hover_animation_->SetSlideDuration(kHoverFadeDurationMs); } diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h index 4d864b4..b818ffd 100644 --- a/ui/views/controls/button/custom_button.h +++ b/ui/views/controls/button/custom_button.h @@ -6,11 +6,11 @@ #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ #include "base/memory/scoped_ptr.h" -#include "ui/base/animation/animation_delegate.h" #include "ui/base/events/event_constants.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/views/controls/button/button.h" -namespace ui { +namespace gfx { class ThrobAnimation; } @@ -24,7 +24,7 @@ class CustomButtonStateChangedDelegate; // part of the focus chain. Call set_focusable(true) to make it part of the // focus chain. class VIEWS_EXPORT CustomButton : public Button, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: // The menu button's class name. static const char kViewClassName[]; @@ -84,8 +84,8 @@ class VIEWS_EXPORT CustomButton : public Button, virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void VisibilityChanged(View* starting_from, bool is_visible) 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; // Takes ownership of the delegate. void set_state_changed_delegate(CustomButtonStateChangedDelegate* delegate) { @@ -120,7 +120,7 @@ class VIEWS_EXPORT CustomButton : public Button, ButtonState state_; // Hover animation. - scoped_ptr<ui::ThrobAnimation> hover_animation_; + scoped_ptr<gfx::ThrobAnimation> hover_animation_; private: // Should we animate when the state changes? Defaults to true. diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc index f6cff61..17f7416 100644 --- a/ui/views/controls/button/image_button.cc +++ b/ui/views/controls/button/image_button.cc @@ -6,7 +6,7 @@ #include "base/strings/utf_string_conversions.h" #include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/animation/throb_animation.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/views/widget/widget.h" diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 7abdc3b..901dbf4 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc @@ -6,8 +6,8 @@ #include "base/logging.h" #include "grit/ui_resources.h" -#include "ui/base/animation/throb_animation.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/sys_color_change_listener.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/button/label_button_border.h" @@ -346,7 +346,7 @@ ui::NativeTheme::State LabelButton::GetThemeState( return ui::NativeTheme::kNormal; } -const ui::Animation* LabelButton::GetThemeAnimation() const { +const gfx::Animation* LabelButton::GetThemeAnimation() const { #if defined(OS_WIN) if (style() == STYLE_NATIVE_TEXTBUTTON && GetNativeTheme() == ui::NativeThemeWin::instance()) { diff --git a/ui/views/controls/button/label_button.h b/ui/views/controls/button/label_button.h index 0f50191..139ea76 100644 --- a/ui/views/controls/button/label_button.h +++ b/ui/views/controls/button/label_button.h @@ -98,7 +98,7 @@ class VIEWS_EXPORT LabelButton : public CustomButton, virtual gfx::Rect GetThemePaintRect() const OVERRIDE; virtual ui::NativeTheme::State GetThemeState( ui::NativeTheme::ExtraParams* params) const OVERRIDE; - virtual const ui::Animation* GetThemeAnimation() const OVERRIDE; + virtual const gfx::Animation* GetThemeAnimation() const OVERRIDE; virtual ui::NativeTheme::State GetBackgroundThemeState( ui::NativeTheme::ExtraParams* params) const OVERRIDE; virtual ui::NativeTheme::State GetForegroundThemeState( diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc index 34ea502..fb6ea06 100644 --- a/ui/views/controls/button/label_button_border.cc +++ b/ui/views/controls/button/label_button_border.cc @@ -8,8 +8,8 @@ #include "grit/ui_resources.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/effects/SkLerpXfermode.h" -#include "ui/base/animation/animation.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/rect.h" #include "ui/gfx/skia_util.h" @@ -118,7 +118,7 @@ void LabelButtonBorder::Paint(const View& view, gfx::Canvas* canvas) { gfx::Rect rect(native_theme_delegate->GetThemePaintRect()); ui::NativeTheme::ExtraParams extra; const ui::NativeTheme* theme = view.GetNativeTheme(); - const ui::Animation* animation = native_theme_delegate->GetThemeAnimation(); + const gfx::Animation* animation = native_theme_delegate->GetThemeAnimation(); ui::NativeTheme::State state = native_theme_delegate->GetThemeState(&extra); if (animation && animation->is_animating()) { diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc index a02d6b2..38e9691 100644 --- a/ui/views/controls/button/text_button.cc +++ b/ui/views/controls/button/text_button.cc @@ -8,8 +8,8 @@ #include "base/logging.h" #include "grit/ui_resources.h" -#include "ui/base/animation/throb_animation.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.h" #include "ui/views/controls/button/button.h" @@ -345,7 +345,7 @@ void TextButtonBase::OnBoundsChanged(const gfx::Rect& previous_bounds) { UpdateTextSize(); } -const ui::Animation* TextButtonBase::GetAnimation() const { +const gfx::Animation* TextButtonBase::GetAnimation() const { return hover_animation_.get(); } @@ -570,7 +570,7 @@ ui::NativeTheme::State TextButtonBase::GetThemeState( } } -const ui::Animation* TextButtonBase::GetThemeAnimation() const { +const gfx::Animation* TextButtonBase::GetThemeAnimation() const { #if defined(OS_WIN) if (GetNativeTheme() == ui::NativeThemeWin::instance()) { return ui::NativeThemeWin::instance()->IsThemingActive() ? diff --git a/ui/views/controls/button/text_button.h b/ui/views/controls/button/text_button.h index c66f288..5dccaa2 100644 --- a/ui/views/controls/button/text_button.h +++ b/ui/views/controls/button/text_button.h @@ -142,7 +142,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton, void set_alignment(TextAlignment alignment) { alignment_ = alignment; } - const ui::Animation* GetAnimation() const; + const gfx::Animation* GetAnimation() const; void SetIsDefault(bool is_default); bool is_default() const { return is_default_; } @@ -234,7 +234,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton, virtual gfx::Rect GetThemePaintRect() const OVERRIDE; virtual ui::NativeTheme::State GetThemeState( ui::NativeTheme::ExtraParams* params) const OVERRIDE; - virtual const ui::Animation* GetThemeAnimation() const OVERRIDE; + virtual const gfx::Animation* GetThemeAnimation() const OVERRIDE; virtual ui::NativeTheme::State GetBackgroundThemeState( ui::NativeTheme::ExtraParams* params) const OVERRIDE; virtual ui::NativeTheme::State GetForegroundThemeState( diff --git a/ui/views/controls/glow_hover_controller.cc b/ui/views/controls/glow_hover_controller.cc index f2e3bf2..f7fcd3f 100644 --- a/ui/views/controls/glow_hover_controller.cc +++ b/ui/views/controls/glow_hover_controller.cc @@ -30,7 +30,7 @@ GlowHoverController::~GlowHoverController() { } void GlowHoverController::SetAnimationContainer( - ui::AnimationContainer* container) { + gfx::AnimationContainer* container) { animation_.SetContainer(container); } @@ -45,7 +45,7 @@ void GlowHoverController::Show(Style style) { case SUBTLE: opacity_scale_ = kTrackOpacityScale; animation_.SetSlideDuration(kTrackHoverDurationMs); - animation_.SetTweenType(ui::Tween::EASE_OUT); + animation_.SetTweenType(gfx::Tween::EASE_OUT); animation_.Show(); break; case PRONOUNCED: @@ -58,7 +58,7 @@ void GlowHoverController::Show(Style style) { } void GlowHoverController::Hide() { - animation_.SetTweenType(ui::Tween::EASE_IN); + animation_.SetTweenType(gfx::Tween::EASE_IN); animation_.Hide(); } @@ -117,11 +117,11 @@ void GlowHoverController::Draw(gfx::Canvas* canvas, (view_->height() - mask_image.height()) / 2); } -void GlowHoverController::AnimationEnded(const ui::Animation* animation) { +void GlowHoverController::AnimationEnded(const gfx::Animation* animation) { view_->SchedulePaint(); } -void GlowHoverController::AnimationProgressed(const ui::Animation* animation) { +void GlowHoverController::AnimationProgressed(const gfx::Animation* animation) { view_->SchedulePaint(); } diff --git a/ui/views/controls/glow_hover_controller.h b/ui/views/controls/glow_hover_controller.h index 7d8e62c..2ac423e 100644 --- a/ui/views/controls/glow_hover_controller.h +++ b/ui/views/controls/glow_hover_controller.h @@ -5,8 +5,8 @@ #ifndef UI_VIEWS_CONTROLS_GLOW_HOVER_CONTROLLER_H_ #define UI_VIEWS_CONTROLS_GLOW_HOVER_CONTROLLER_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" #include "ui/views/views_export.h" namespace gfx { @@ -27,7 +27,7 @@ class View; // OnPaint() -> if ShouldDraw() returns true invoke Draw(). // Internally GlowHoverController uses an animation to animate the glow and // invokes SchedulePaint() back on the View as necessary. -class VIEWS_EXPORT GlowHoverController : public ui::AnimationDelegate { +class VIEWS_EXPORT GlowHoverController : public gfx::AnimationDelegate { public: enum Style { SUBTLE, @@ -38,7 +38,7 @@ class VIEWS_EXPORT GlowHoverController : public ui::AnimationDelegate { virtual ~GlowHoverController(); // Sets the AnimationContainer used by the animation. - void SetAnimationContainer(ui::AnimationContainer* container); + void SetAnimationContainer(gfx::AnimationContainer* container); // Sets the location of the hover, relative to the View passed to the // constructor. @@ -64,16 +64,16 @@ class VIEWS_EXPORT GlowHoverController : public ui::AnimationDelegate { // |mask_image| is used to determine what parts of the canvas to draw on. void Draw(gfx::Canvas* canvas, const gfx::ImageSkia& mask_image) const; - // ui::AnimationDelegate overrides: - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: // View we're drawing to. views::View* view_; // Opacity of the glow ramps up over time. - ui::SlideAnimation animation_; + gfx::SlideAnimation animation_; // Location of the glow, relative to view. gfx::Point location_; diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/ui/views/controls/scrollbar/overlay_scroll_bar.cc index 25228e4..176f7b9 100644 --- a/ui/views/controls/scrollbar/overlay_scroll_bar.cc +++ b/ui/views/controls/scrollbar/overlay_scroll_bar.cc @@ -23,7 +23,7 @@ const int kThumbHoverAlpha = 128; const int kThumbDefaultAlpha = 64; class OverlayScrollBarThumb : public BaseScrollBarThumb, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: explicit OverlayScrollBarThumb(BaseScrollBar* scroll_bar); virtual ~OverlayScrollBarThumb(); @@ -33,8 +33,8 @@ class OverlayScrollBarThumb : public BaseScrollBarThumb, virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; private: double animation_opacity_; @@ -77,7 +77,7 @@ void OverlayScrollBarThumb::OnPaint(gfx::Canvas* canvas) { } void OverlayScrollBarThumb::AnimationProgressed( - const ui::Animation* animation) { + const gfx::Animation* animation) { animation_opacity_ = animation->GetCurrentValue(); SchedulePaint(); } diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.h b/ui/views/controls/scrollbar/overlay_scroll_bar.h index ac64d35..b061da0 100644 --- a/ui/views/controls/scrollbar/overlay_scroll_bar.h +++ b/ui/views/controls/scrollbar/overlay_scroll_bar.h @@ -5,7 +5,7 @@ #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ #define UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ -#include "ui/base/animation/slide_animation.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/views/controls/scrollbar/base_scroll_bar.h" namespace views { @@ -33,7 +33,7 @@ class VIEWS_EXPORT OverlayScrollBar : public BaseScrollBar { virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; private: - ui::SlideAnimation animation_; + gfx::SlideAnimation animation_; DISALLOW_COPY_AND_ASSIGN(OverlayScrollBar); }; diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc index 2b74121..a715c96 100644 --- a/ui/views/controls/slider.cc +++ b/ui/views/controls/slider.cc @@ -13,9 +13,9 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPaint.h" #include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/animation/slide_animation.h" #include "ui/base/events/event.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -95,7 +95,7 @@ void Slider::SetValueInternal(float value, SliderChangeReason reason) { // Do not animate when setting the value of the slider for the first time. // There is no message-loop when running tests. So we cannot animate then. animating_value_ = old_value; - move_animation_.reset(new ui::SlideAnimation(this)); + move_animation_.reset(new gfx::SlideAnimation(this)); move_animation_->SetSlideDuration(kSlideValueChangeDurationMS); move_animation_->Show(); AnimationProgressed(move_animation_.get()); @@ -304,7 +304,7 @@ void Slider::OnGestureEvent(ui::GestureEvent* event) { } } -void Slider::AnimationProgressed(const ui::Animation* animation) { +void Slider::AnimationProgressed(const gfx::Animation* animation) { animating_value_ = animation->CurrentValueBetween(animating_value_, value_); SchedulePaint(); } diff --git a/ui/views/controls/slider.h b/ui/views/controls/slider.h index 5cfd3f5..3c17e94 100644 --- a/ui/views/controls/slider.h +++ b/ui/views/controls/slider.h @@ -5,7 +5,7 @@ #ifndef UI_VIEWS_CONTROLS_SLIDER_H_ #define UI_VIEWS_CONTROLS_SLIDER_H_ -#include "ui/base/animation/animation_delegate.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/views/view.h" #include "ui/views/views_export.h" @@ -13,9 +13,6 @@ typedef unsigned int SkColor; namespace gfx { class ImageSkia; -} - -namespace ui { class SlideAnimation; } @@ -45,7 +42,7 @@ class VIEWS_EXPORT SliderListener { }; class VIEWS_EXPORT Slider : public View, - public ui::AnimationDelegate { + public gfx::AnimationDelegate { public: enum Orientation { HORIZONTAL, @@ -96,13 +93,13 @@ class VIEWS_EXPORT Slider : public View, // ui::EventHandler overrides: virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; - // ui::AnimationDelegate overrides: - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; + // gfx::AnimationDelegate overrides: + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; SliderListener* listener_; Orientation orientation_; - scoped_ptr<ui::SlideAnimation> move_animation_; + scoped_ptr<gfx::SlideAnimation> move_animation_; float value_; float keyboard_increment_; diff --git a/ui/views/corewm/window_animations.cc b/ui/views/corewm/window_animations.cc index f346e22..84759fe 100644 --- a/ui/views/corewm/window_animations.cc +++ b/ui/views/corewm/window_animations.cc @@ -336,7 +336,7 @@ ui::LayerAnimationElement* CreateGrowShrinkElement( base::TimeDelta::FromMilliseconds( kWindowAnimation_Bounce_DurationMS * kWindowAnimation_Bounce_GrowShrinkDurationPercent / 100))); - transition->set_tween_type(grow ? ui::Tween::EASE_OUT : ui::Tween::EASE_IN); + transition->set_tween_type(grow ? gfx::Tween::EASE_OUT : gfx::Tween::EASE_IN); return transition.release(); } @@ -380,7 +380,7 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) { ui::LayerAnimationElement::CreateOpacityElement( show ? kWindowAnimation_ShowOpacity : kWindowAnimation_HideOpacity, duration * kWindowAnimation_Rotate_OpacityDurationPercent / 100)); - opacity->set_tween_type(ui::Tween::EASE_IN_OUT); + opacity->set_tween_type(gfx::Tween::EASE_IN_OUT); window->layer()->GetAnimator()->ScheduleAnimation( new ui::LayerAnimationSequence(opacity.release())); diff --git a/ui/views/corewm/window_animations_unittest.cc b/ui/views/corewm/window_animations_unittest.cc index 26fda67..5332c7d 100644 --- a/ui/views/corewm/window_animations_unittest.cc +++ b/ui/views/corewm/window_animations_unittest.cc @@ -9,10 +9,10 @@ #include "ui/aura/test/aura_test_base.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; diff --git a/ui/views/native_theme_delegate.h b/ui/views/native_theme_delegate.h index d4bc880..f17f164 100644 --- a/ui/views/native_theme_delegate.h +++ b/ui/views/native_theme_delegate.h @@ -34,7 +34,7 @@ class VIEWS_EXPORT NativeThemeDelegate { // If the native theme drawign should be animated, return the Animation object // that controlls it. If no animation is ongoing, NULL may be returned. - virtual const ui::Animation* GetThemeAnimation() const = 0; + virtual const gfx::Animation* GetThemeAnimation() const = 0; // If animation is onging, this returns the background native theme state. virtual ui::NativeTheme::State GetBackgroundThemeState( |