diff options
Diffstat (limited to 'chrome/browser/ui/views/infobars')
5 files changed, 25 insertions, 21 deletions
diff --git a/chrome/browser/ui/views/infobars/extension_infobar.cc b/chrome/browser/ui/views/infobars/extension_infobar.cc index e2fb43f..9540b5d 100644 --- a/chrome/browser/ui/views/infobars/extension_infobar.cc +++ b/chrome/browser/ui/views/infobars/extension_infobar.cc @@ -5,7 +5,6 @@ #include "chrome/browser/views/infobars/extension_infobar.h" #include "app/resource_bundle.h" -#include "app/slide_animation.h" #include "chrome/browser/extensions/extension_context_menu_model.h" #include "chrome/browser/extensions/extension_infobar_delegate.h" #include "chrome/browser/extensions/extension_host.h" @@ -16,6 +15,7 @@ #include "chrome/common/extensions/extension_resource.h" #include "gfx/canvas_skia.h" #include "grit/theme_resources.h" +#include "ui/base/animation/slide_animation.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/menu_2.h" #include "views/widget/widget.h" diff --git a/chrome/browser/ui/views/infobars/infobars.cc b/chrome/browser/ui/views/infobars/infobars.cc index 4cda653..d1af02e 100644 --- a/chrome/browser/ui/views/infobars/infobars.cc +++ b/chrome/browser/ui/views/infobars/infobars.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/slide_animation.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" #include "chrome/browser/views/event_utils.h" @@ -14,6 +13,7 @@ #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/animation/slide_animation.h" #include "views/background.h" #include "views/controls/button/image_button.h" #include "views/controls/button/native_button.h" @@ -119,8 +119,8 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE))); AddChildView(close_button_); - animation_.reset(new SlideAnimation(this)); - animation_->SetTweenType(Tween::LINEAR); + animation_.reset(new ui::SlideAnimation(this)); + animation_->SetTweenType(ui::Tween::LINEAR); } InfoBar::~InfoBar() { @@ -210,14 +210,14 @@ void InfoBar::FocusWillChange(View* focused_before, View* focused_now) { } } -// InfoBar, AnimationDelegate implementation: ---------------------------------- +// InfoBar, ui::AnimationDelegate implementation: ------------------------------ -void InfoBar::AnimationProgressed(const Animation* animation) { +void InfoBar::AnimationProgressed(const ui::Animation* animation) { if (container_) container_->InfoBarAnimated(true); } -void InfoBar::AnimationEnded(const Animation* animation) { +void InfoBar::AnimationEnded(const ui::Animation* animation) { if (container_) { container_->InfoBarAnimated(false); diff --git a/chrome/browser/ui/views/infobars/infobars.h b/chrome/browser/ui/views/infobars/infobars.h index 2e32ac6..b6fc879 100644 --- a/chrome/browser/ui/views/infobars/infobars.h +++ b/chrome/browser/ui/views/infobars/infobars.h @@ -6,15 +6,19 @@ #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBARS_H_ #pragma once -#include "app/animation_delegate.h" #include "base/task.h" #include "chrome/browser/tab_contents/infobar_delegate.h" +#include "ui/base/animation/animation_delegate.h" #include "views/controls/button/button.h" #include "views/controls/link.h" #include "views/focus/focus_manager.h" class InfoBarContainer; + +namespace ui { class SlideAnimation; +} + namespace views { class ExternalFocusTracker; class ImageButton; @@ -43,7 +47,7 @@ class InfoBarBackground : public views::Background { class InfoBar : public views::View, public views::ButtonListener, public views::FocusChangeListener, - public AnimationDelegate { + public ui::AnimationDelegate { public: explicit InfoBar(InfoBarDelegate* delegate); virtual ~InfoBar(); @@ -86,7 +90,7 @@ class InfoBar : public views::View, void set_target_height(double height) { target_height_ = height; } - SlideAnimation* animation() { return animation_.get(); } + ui::SlideAnimation* animation() { return animation_.get(); } // Returns a centered y-position of a control of height specified in // |prefsize| within the standard InfoBar height. Stable during an animation. @@ -104,9 +108,9 @@ class InfoBar : public views::View, // Overridden from views::FocusChangeListener: virtual void FocusWillChange(View* focused_before, View* focused_now); - // Overridden from AnimationDelegate: - virtual void AnimationProgressed(const Animation* animation); - virtual void AnimationEnded(const Animation* animation); + // Overridden from ui::AnimationDelegate: + virtual void AnimationProgressed(const ui::Animation* animation); + virtual void AnimationEnded(const ui::Animation* animation); private: friend class InfoBarContainer; @@ -150,7 +154,7 @@ class InfoBar : public views::View, views::ImageButton* close_button_; // The animation that runs when the InfoBar is opened or closed. - scoped_ptr<SlideAnimation> animation_; + scoped_ptr<ui::SlideAnimation> animation_; // Tracks and stores the last focused view which is not the InfoBar or any of // its children. Used to restore focus once the InfoBar is closed. diff --git a/chrome/browser/ui/views/infobars/translate_infobar_base.cc b/chrome/browser/ui/views/infobars/translate_infobar_base.cc index 4eb0bdd..fec6886 100644 --- a/chrome/browser/ui/views/infobars/translate_infobar_base.cc +++ b/chrome/browser/ui/views/infobars/translate_infobar_base.cc @@ -5,7 +5,6 @@ #include "chrome/browser/views/infobars/translate_infobar_base.h" #include "app/resource_bundle.h" -#include "app/slide_animation.h" #include "base/utf_string_conversions.h" #include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/browser/views/infobars/after_translate_infobar.h" @@ -14,6 +13,7 @@ #include "chrome/browser/views/infobars/infobar_button_border.h" #include "gfx/canvas_skia.h" #include "grit/theme_resources.h" +#include "ui/base/animation/slide_animation.h" #include "views/controls/button/menu_button.h" #include "views/controls/image_view.h" @@ -31,8 +31,8 @@ TranslateInfoBarBase::TranslateInfoBarBase( TranslateInfoBarDelegate::BackgroundAnimationType animation = delegate->background_animation_type(); if (animation != TranslateInfoBarDelegate::NONE) { - background_color_animation_.reset(new SlideAnimation(this)); - background_color_animation_->SetTweenType(Tween::LINEAR); + background_color_animation_.reset(new ui::SlideAnimation(this)); + background_color_animation_->SetTweenType(ui::Tween::LINEAR); background_color_animation_->SetSlideDuration(500); if (animation == TranslateInfoBarDelegate::NORMAL_TO_ERROR) { background_color_animation_->Show(); @@ -81,7 +81,7 @@ void TranslateInfoBarBase::PaintBackground(gfx::Canvas* canvas) { error_background_); } -void TranslateInfoBarBase::AnimationProgressed(const Animation* animation) { +void TranslateInfoBarBase::AnimationProgressed(const ui::Animation* animation) { if (background_color_animation_.get() == animation) SchedulePaint(); // That'll trigger a PaintBackgroud. else diff --git a/chrome/browser/ui/views/infobars/translate_infobar_base.h b/chrome/browser/ui/views/infobars/translate_infobar_base.h index 2c5d091..3f49c01 100644 --- a/chrome/browser/ui/views/infobars/translate_infobar_base.h +++ b/chrome/browser/ui/views/infobars/translate_infobar_base.h @@ -33,8 +33,8 @@ class TranslateInfoBarBase : public TranslateInfoBarView, virtual void PaintBackground(gfx::Canvas* canvas); protected: - // Overridden from AnimationDelegate: - virtual void AnimationProgressed(const Animation* animation); + // Overridden from ui::AnimationDelegate: + virtual void AnimationProgressed(const ui::Animation* animation); // Creates a label with the appropriate font and color for the translate // infobars. @@ -57,7 +57,7 @@ class TranslateInfoBarBase : public TranslateInfoBarView, InfoBarBackground normal_background_; InfoBarBackground error_background_; - scoped_ptr<SlideAnimation> background_color_animation_; + scoped_ptr<ui::SlideAnimation> background_color_animation_; private: // Returns the background that should be displayed when not animating. |