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

Unified Diff: chrome/browser/views/status_bubble_views.cc

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 years, 8 months 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
« no previous file with comments | « chrome/browser/views/infobars/translate_infobars.cc ('k') | chrome/browser/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/status_bubble_views.cc
diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc
index f020ef4f142d0ef6812f7ef0ddaa3bfd03a54474..4de0597bbb17e44e1d4a6f96b0eed428c81b1653 100644
--- a/chrome/browser/views/status_bubble_views.cc
+++ b/chrome/browser/views/status_bubble_views.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/animation.h"
+#include "app/linear_animation.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/text_elider.h"
@@ -68,12 +68,12 @@ static const int kMaxExpansionStepDurationMS = 150;
// StatusView manages the display of the bubble, applying text changes and
// fading in or out the bubble as required.
class StatusBubbleViews::StatusView : public views::Label,
- public Animation,
+ public LinearAnimation,
public AnimationDelegate {
public:
StatusView(StatusBubble* status_bubble, views::Widget* popup,
ThemeProvider* theme_provider)
- : ALLOW_THIS_IN_INITIALIZER_LIST(Animation(kFramerate, this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(LinearAnimation(kFramerate, this)),
stage_(BUBBLE_HIDDEN),
style_(STYLE_STANDARD),
ALLOW_THIS_IN_INITIALIZER_LIST(timer_factory_(this)),
@@ -310,7 +310,7 @@ void StatusBubbleViews::StatusView::StartShowing() {
// Animation functions.
double StatusBubbleViews::StatusView::GetCurrentOpacity() {
return opacity_start_ + (opacity_end_ - opacity_start_) *
- Animation::GetCurrentValue();
+ LinearAnimation::GetCurrentValue();
}
void StatusBubbleViews::StatusView::SetOpacity(double opacity) {
@@ -465,12 +465,12 @@ void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) {
// Manages the expansion and contraction of the status bubble as it accommodates
// URLs too long to fit in the standard bubble. Changes are passed through the
// StatusView to paint.
-class StatusBubbleViews::StatusViewExpander : public Animation,
+class StatusBubbleViews::StatusViewExpander : public LinearAnimation,
public AnimationDelegate {
public:
StatusViewExpander(StatusBubble* status_bubble,
StatusView* status_view)
- : ALLOW_THIS_IN_INITIALIZER_LIST(Animation(kFramerate, this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(LinearAnimation(kFramerate, this)),
status_bubble_(status_bubble),
status_view_(status_view),
expansion_start_(0),
@@ -530,7 +530,7 @@ void StatusBubbleViews::StatusViewExpander::StartExpansion(
int StatusBubbleViews::StatusViewExpander::GetCurrentBubbleWidth() {
return static_cast<int>(expansion_start_ +
- (expansion_end_ - expansion_start_) * Animation::GetCurrentValue());
+ (expansion_end_ - expansion_start_) * LinearAnimation::GetCurrentValue());
}
void StatusBubbleViews::StatusViewExpander::SetBubbleWidth(int width) {
« no previous file with comments | « chrome/browser/views/infobars/translate_infobars.cc ('k') | chrome/browser/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698