Skip to content

Commit

Permalink
ui/base/animation -> ui/gfx/animation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sky@chromium.org committed Sep 15, 2013
1 parent 70cdf8d commit ffb15d1
Show file tree
Hide file tree
Showing 225 changed files with 1,109 additions and 1,111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void RunAnimationForWidget(views::Widget* widget) {

ui::Layer* layer = widget->GetNativeView()->layer();
ui::LayerAnimatorTestController controller(layer->GetAnimator());
ui::AnimationContainerElement* element = layer->GetAnimator();
gfx::AnimationContainerElement* element = layer->GetAnimator();
// Multiple steps are required to complete complex animations.
// TODO(vollick): This should not be necessary. crbug.com/154017
while (controller.animator()->is_animating()) {
Expand Down
6 changes: 3 additions & 3 deletions ash/display/shared_display_edge_indicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/root_window.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
Expand Down Expand Up @@ -88,7 +88,7 @@ void SharedDisplayEdgeIndicator::Show(const gfx::Rect& src_bounds,
dst_indicator_ = new IndicatorView;
CreateWidget(src_bounds, src_indicator_);
CreateWidget(dst_bounds, dst_indicator_);
animation_.reset(new ui::ThrobAnimation(this));
animation_.reset(new gfx::ThrobAnimation(this));
animation_->SetThrobDuration(kIndicatorAnimationDurationMs);
animation_->StartThrobbing(-1 /* infinite */);
}
Expand All @@ -103,7 +103,7 @@ void SharedDisplayEdgeIndicator::Hide() {
}

void SharedDisplayEdgeIndicator::AnimationProgressed(
const ui::Animation* animation) {
const gfx::Animation* animation) {
int value = animation->CurrentValueBetween(0, 255);
SkColor color = SkColorSetARGB(0xFF, value, value, value);
if (src_indicator_)
Expand Down
13 changes: 5 additions & 8 deletions ash/display/shared_display_edge_indicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
#include "ash/ash_export.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/display.h"

namespace gfx {
class Rect;
}

namespace ui {
class ThrobAnimation;
}

Expand All @@ -29,7 +26,7 @@ namespace internal {

// SharedDisplayEdgeIndicator is responsible for showing a window that indicates
// the edge that a window can be dragged into another display.
class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate {
class ASH_EXPORT SharedDisplayEdgeIndicator : public gfx::AnimationDelegate {
public:
SharedDisplayEdgeIndicator();
virtual ~SharedDisplayEdgeIndicator();
Expand All @@ -40,8 +37,8 @@ class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate {
void Show(const gfx::Rect& src_bounds, const gfx::Rect& dst_bounds);
void Hide();

// ui::AnimationDelegate overrides:
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
// gfx::AnimationDelegate overrides:
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;

private:
// Used to show the displays' shared edge where a window can be moved across.
Expand All @@ -51,7 +48,7 @@ class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate {
views::View* dst_indicator_;

// Used to transition the opacity.
scoped_ptr<ui::ThrobAnimation> animation_;
scoped_ptr<gfx::ThrobAnimation> animation_;

DISALLOW_COPY_AND_ASSIGN(SharedDisplayEdgeIndicator);
};
Expand Down
14 changes: 7 additions & 7 deletions ash/drag_drop/drag_drop_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/base/animation/linear_animation.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/events/event.h"
#include "ui/base/events/event_utils.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/animation/linear_animation.h"
#include "ui/gfx/path.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
Expand Down Expand Up @@ -471,17 +471,17 @@ void DragDropController::OnWindowDestroyed(aura::Window* window) {
////////////////////////////////////////////////////////////////////////////////
// DragDropController, protected:

ui::LinearAnimation* DragDropController::CreateCancelAnimation(
gfx::LinearAnimation* DragDropController::CreateCancelAnimation(
int duration,
int frame_rate,
ui::AnimationDelegate* delegate) {
return new ui::LinearAnimation(duration, frame_rate, delegate);
gfx::AnimationDelegate* delegate) {
return new gfx::LinearAnimation(duration, frame_rate, delegate);
}

////////////////////////////////////////////////////////////////////////////////
// DragDropController, private:

void DragDropController::AnimationEnded(const ui::Animation* animation) {
void DragDropController::AnimationEnded(const gfx::Animation* animation) {
cancel_animation_.reset();

// By the time we finish animation, another drag/drop session may have
Expand Down Expand Up @@ -520,14 +520,14 @@ void DragDropController::DoDragCancel(int drag_cancel_animation_duration_ms) {
quit_closure_.Run();
}

void DragDropController::AnimationProgressed(const ui::Animation* animation) {
void DragDropController::AnimationProgressed(const gfx::Animation* animation) {
gfx::Rect current_bounds = animation->CurrentValueBetween(
drag_image_initial_bounds_for_cancel_animation_,
drag_image_final_bounds_for_cancel_animation_);
drag_image_->SetBoundsInScreen(current_bounds);
}

void DragDropController::AnimationCanceled(const ui::Animation* animation) {
void DragDropController::AnimationCanceled(const gfx::Animation* animation) {
AnimationEnded(animation);
}

Expand Down
20 changes: 10 additions & 10 deletions ash/drag_drop/drag_drop_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#include "base/memory/weak_ptr.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/window_observer.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/events/event_constants.h"
#include "ui/base/events/event_handler.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/rect.h"

namespace aura {
class RootWindow;
class Window;
}

namespace ui {
namespace gfx {
class LinearAnimation;
}

Expand All @@ -40,7 +40,7 @@ class DragImageView;
class ASH_EXPORT DragDropController
: public aura::client::DragDropClient,
public ui::EventHandler,
public ui::AnimationDelegate,
public gfx::AnimationDelegate,
public aura::WindowObserver {
public:
DragDropController();
Expand Down Expand Up @@ -78,21 +78,21 @@ class ASH_EXPORT DragDropController
// Helper method to create a LinearAnimation object that will run the drag
// cancel animation. Caller take ownership of the returned object. Protected
// for testing.
virtual ui::LinearAnimation* CreateCancelAnimation(
virtual gfx::LinearAnimation* CreateCancelAnimation(
int duration,
int frame_rate,
ui::AnimationDelegate* delegate);
gfx::AnimationDelegate* delegate);

// Actual implementation of |DragCancel()|. protected for testing.
virtual void DoDragCancel(int drag_cancel_animation_duration_ms);

private:
friend class ash::test::DragDropControllerTest;

// Overridden from ui::AnimationDelegate:
virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE;
// Overridden from gfx::AnimationDelegate:
virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;

// Helper method to start drag widget flying back animation.
void StartCanceledAnimation(int animation_duration_ms);
Expand All @@ -115,7 +115,7 @@ class ASH_EXPORT DragDropController
gfx::Rect drag_image_initial_bounds_for_cancel_animation_;
gfx::Rect drag_image_final_bounds_for_cancel_animation_;

scoped_ptr<ui::LinearAnimation> cancel_animation_;
scoped_ptr<gfx::LinearAnimation> cancel_animation_;

// Window that started the drag.
aura::Window* drag_source_window_;
Expand Down
12 changes: 6 additions & 6 deletions ash/drag_drop/drag_drop_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "ui/aura/client/capture_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/base/animation/linear_animation.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/dragdrop/drag_drop_types.h"
Expand All @@ -24,6 +23,7 @@
#include "ui/base/events/event_utils.h"
#include "ui/base/gestures/gesture_types.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/animation/linear_animation.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/views/test/test_views_delegate.h"
#include "ui/views/view.h"
Expand Down Expand Up @@ -130,12 +130,12 @@ class DragTestView : public views::View {
DISALLOW_COPY_AND_ASSIGN(DragTestView);
};

class CompletableLinearAnimation : public ui::LinearAnimation {
class CompletableLinearAnimation : public gfx::LinearAnimation {
public:
CompletableLinearAnimation(int duration,
int frame_rate,
ui::AnimationDelegate* delegate)
: ui::LinearAnimation(duration, frame_rate, delegate),
gfx::AnimationDelegate* delegate)
: gfx::LinearAnimation(duration, frame_rate, delegate),
duration_(duration) {
}

Expand Down Expand Up @@ -191,10 +191,10 @@ class TestDragDropController : public internal::DragDropController {
drag_canceled_ = true;
}

virtual ui::LinearAnimation* CreateCancelAnimation(
virtual gfx::LinearAnimation* CreateCancelAnimation(
int duration,
int frame_rate,
ui::AnimationDelegate* delegate) OVERRIDE {
gfx::AnimationDelegate* delegate) OVERRIDE {
return new CompletableLinearAnimation(duration, frame_rate, delegate);
}

Expand Down
18 changes: 9 additions & 9 deletions ash/launcher/launcher_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include "grit/ash_resources.h"
#include "skia/ext/image_operations.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/base/events/event_constants.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia_operations.h"
Expand Down Expand Up @@ -46,7 +46,7 @@ bool ShouldHop(int state) {

// Simple AnimationDelegate that owns a single ThrobAnimation instance to
// keep all Draw Attention animations in sync.
class LauncherButtonAnimation : public ui::AnimationDelegate {
class LauncherButtonAnimation : public gfx::AnimationDelegate {
public:
class Observer {
public:
Expand Down Expand Up @@ -83,30 +83,30 @@ class LauncherButtonAnimation : public ui::AnimationDelegate {
LauncherButtonAnimation()
: animation_(this) {
animation_.SetThrobDuration(kAttentionThrobDurationMS);
animation_.SetTweenType(ui::Tween::SMOOTH_IN_OUT);
animation_.SetTweenType(gfx::Tween::SMOOTH_IN_OUT);
}

virtual ~LauncherButtonAnimation() {
}

ui::ThrobAnimation& GetThrobAnimation() {
gfx::ThrobAnimation& GetThrobAnimation() {
if (!animation_.is_animating()) {
animation_.Reset();
animation_.StartThrobbing(-1 /*throb indefinitely*/);
}
return animation_;
}

// ui::AnimationDelegate
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE {
// gfx::AnimationDelegate
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE {
if (animation != &animation_)
return;
if (!animation_.is_animating())
return;
FOR_EACH_OBSERVER(Observer, observers_, AnimationProgressed());
}

ui::ThrobAnimation animation_;
gfx::ThrobAnimation animation_;
ObserverList<Observer> observers_;

DISALLOW_COPY_AND_ASSIGN(LauncherButtonAnimation);
Expand Down Expand Up @@ -319,7 +319,7 @@ void LauncherButton::ClearState(State state) {
(!ShouldHop(state) || ShouldHop(state_))) {
ui::ScopedLayerAnimationSettings scoped_setter(
icon_view_->layer()->GetAnimator());
scoped_setter.SetTweenType(ui::Tween::LINEAR);
scoped_setter.SetTweenType(gfx::Tween::LINEAR);
scoped_setter.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kHopDownMS));
}
Expand Down
2 changes: 1 addition & 1 deletion ash/launcher/launcher_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "ui/views/view_model_utils.h"
#include "ui/views/widget/widget.h"

using ui::Animation;
using gfx::Animation;
using views::View;

namespace ash {
Expand Down
2 changes: 1 addition & 1 deletion ash/magnifier/magnification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip,
settings.AddObserver(this);
settings.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
settings.SetTweenType(ui::Tween::EASE_OUT);
settings.SetTweenType(gfx::Tween::EASE_OUT);
settings.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(animate ? 100 : 0));

Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/background_animator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void BackgroundAnimator::SetPaintsBackground(bool value, ChangeType type) {
animation_.Hide();
}

void BackgroundAnimator::AnimationProgressed(const ui::Animation* animation) {
void BackgroundAnimator::AnimationProgressed(const gfx::Animation* animation) {
int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_);
if (alpha_ == alpha)
return;
Expand Down
12 changes: 6 additions & 6 deletions ash/shelf/background_animator.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include "ash/ash_export.h"
#include "base/basictypes.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/animation/slide_animation.h"

namespace ash {
namespace internal {
Expand All @@ -23,7 +23,7 @@ class ASH_EXPORT BackgroundAnimatorDelegate {
};

// BackgroundAnimator is used by the shelf to animate the background (alpha).
class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate {
class ASH_EXPORT BackgroundAnimator : public gfx::AnimationDelegate {
public:
// How the background can be changed.
enum ChangeType {
Expand All @@ -48,16 +48,16 @@ class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate {
// Current alpha.
int alpha() const { return alpha_; }

// ui::AnimationDelegate overrides:
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
// gfx::AnimationDelegate overrides:
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;

private:
BackgroundAnimatorDelegate* delegate_;

const int min_alpha_;
const int max_alpha_;

ui::SlideAnimation animation_;
gfx::SlideAnimation animation_;

// Whether the background is painted.
bool paints_background_;
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/overflow_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "grit/ash_strings.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/skbitmap_operations.h"
Expand Down
Loading

0 comments on commit ffb15d1

Please sign in to comment.