Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7512)

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 73723002: [rAc OSX] Animate the dots in the "Loading ..." message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add a missing semicolon Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index 455e20885367846b5ac7cd613273fe21bfe313f7..d6c2a71ba219c707a07bf25aefb078b3c3d67bad 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -391,9 +391,7 @@ class LoadingAnimationView : public views::View,
public gfx::AnimationDelegate {
public:
explicit LoadingAnimationView(const base::string16& text) :
- container_(new views::View()),
- animation_(this) {
-
+ container_(new views::View()) {
set_background(views::Background::CreateSolidBackground(
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_DialogBackground)));
@@ -404,6 +402,7 @@ class LoadingAnimationView : public views::View,
gfx::Font font = ui::ResourceBundle::GetSharedInstance().GetFont(
ui::ResourceBundle::BaseFont).DeriveFont(8);
+ animation_.reset(new LoadingAnimation(this, font.GetHeight()));
views::Label* label = new views::Label();
label->SetText(text);
@@ -423,9 +422,9 @@ class LoadingAnimationView : public views::View,
// views::View implementation.
virtual void SetVisible(bool visible) OVERRIDE {
if (visible)
- animation_.Start();
+ animation_->Start();
else
- animation_.Reset();
+ animation_->Reset();
views::View::SetVisible(visible);
}
@@ -441,13 +440,13 @@ class LoadingAnimationView : public views::View,
for (size_t i = 0; i < 3; ++i) {
views::View* dot = container_->child_at(i + 1);
- dot->SetY(dot->y() + animation_.GetCurrentValueForDot(i) * 10.0);
+ dot->SetY(dot->y() + animation_->GetCurrentValueForDot(i));
}
}
// gfx::AnimationDelegate implementation.
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE {
- DCHECK_EQ(animation, &animation_);
+ DCHECK_EQ(animation, animation_.get());
Layout();
}
@@ -455,7 +454,7 @@ class LoadingAnimationView : public views::View,
// Contains the "Loading" label and the dots.
views::View* container_;
- LoadingAnimation animation_;
+ scoped_ptr<LoadingAnimation> animation_;
DISALLOW_COPY_AND_ASSIGN(LoadingAnimationView);
};
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_loading_shield_controller.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698