summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/infobars
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-24 16:24:13 +0100
committerKristian Monsen <kristianm@google.com>2011-05-25 14:13:32 +0100
commit3f50c38dc070f4bb515c1b64450dae14f316474e (patch)
tree29f309f9534e05c47244eedb438fc612578d133b /chrome/browser/ui/views/infobars
parente23bef148f7be2bdf9c3cb2cd3aa5ceebf1190fb (diff)
downloadexternal_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.zip
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.gz
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.bz2
Merge Chromium at r10.0.634.0: Initial merge by git.
Change-Id: Iac2af492818d119bcc2562eb5fdabf5ab0b6df9c
Diffstat (limited to 'chrome/browser/ui/views/infobars')
-rw-r--r--chrome/browser/ui/views/infobars/extension_infobar.cc2
-rw-r--r--chrome/browser/ui/views/infobars/infobar_container.cc4
-rw-r--r--chrome/browser/ui/views/infobars/infobars.cc25
-rw-r--r--chrome/browser/ui/views/infobars/infobars.h18
-rw-r--r--chrome/browser/ui/views/infobars/translate_infobar_base.cc8
-rw-r--r--chrome/browser/ui/views/infobars/translate_infobar_base.h6
6 files changed, 36 insertions, 27 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/infobar_container.cc b/chrome/browser/ui/views/infobars/infobar_container.cc
index 527aacc..e9706ff 100644
--- a/chrome/browser/ui/views/infobars/infobar_container.cc
+++ b/chrome/browser/ui/views/infobars/infobar_container.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/views/infobars/infobar_container.h"
#include "app/l10n_util.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/view_ids.h"
@@ -19,7 +20,8 @@ InfoBarContainer::InfoBarContainer(Delegate* delegate)
: delegate_(delegate),
tab_contents_(NULL) {
SetID(VIEW_ID_INFO_BAR_CONTAINER);
- SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_CONTAINER));
+ SetAccessibleName(
+ UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER)));
}
InfoBarContainer::~InfoBarContainer() {
diff --git a/chrome/browser/ui/views/infobars/infobars.cc b/chrome/browser/ui/views/infobars/infobars.cc
index 756ce70..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"
@@ -23,7 +23,7 @@
#include "views/widget/widget.h"
#if defined(OS_WIN)
-#include "app/win_util.h"
+#include "app/win/hwnd_util.h"
#endif
// static
@@ -96,10 +96,12 @@ InfoBar::InfoBar(InfoBarDelegate* delegate)
switch (delegate->GetInfoBarType()) {
case InfoBarDelegate::WARNING_TYPE:
- SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_WARNING));
+ SetAccessibleName(UTF16ToWide(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_WARNING)));
break;
case InfoBarDelegate::PAGE_ACTION_TYPE:
- SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_INFOBAR_PAGE_ACTION));
+ SetAccessibleName(UTF16ToWide(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_PAGE_ACTION)));
break;
default:
NOTREACHED();
@@ -113,11 +115,12 @@ InfoBar::InfoBar(InfoBarDelegate* delegate)
rb.GetBitmapNamed(IDR_CLOSE_BAR_H));
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_CLOSE_BAR_P));
- close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE));
+ close_button_->SetAccessibleName(
+ 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() {
@@ -207,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);
@@ -243,7 +246,7 @@ void InfoBar::AnimateClose() {
// Do not restore focus (and active state with it) on Windows if some other
// top-level window became active.
if (GetWidget() &&
- !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) {
+ !app::win::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) {
restore_focus = false;
}
#endif // defined(OS_WIN)
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.