diff options
Diffstat (limited to 'chrome/browser/views')
18 files changed, 48 insertions, 53 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc index 4f71b75..f569ff9 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc @@ -522,7 +522,7 @@ AutocompletePopupContentsView::~AutocompletePopupContentsView() { } gfx::Rect AutocompletePopupContentsView::GetPopupBounds() const { - if (!size_animation_.IsAnimating()) + if (!size_animation_.is_animating()) return target_bounds_; gfx::Rect current_frame_bounds = start_bounds_; diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index e67d212..d6b1690 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -1104,7 +1104,7 @@ void BookmarkBarView::WriteDragData(View* sender, } int BookmarkBarView::GetDragOperations(View* sender, const gfx::Point& p) { - if (size_animation_->IsAnimating() || + if (size_animation_->is_animating() || (size_animation_->GetCurrentValue() == 0 && !OnNewTabPage())) { // Don't let the user drag while animating open or we're closed (and not on // the new tab page, on the new tab page size_animation_ is always 0). This diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index 6eb975c..b23641b 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -157,7 +157,7 @@ class BookmarkBarView : public DetachableToolbarView, int GetToolbarOverlap(bool return_max); // Whether or not we are animating. - bool IsAnimating() { return size_animation_->IsAnimating(); } + bool is_animating() { return size_animation_->is_animating(); } // SlideAnimationDelegate implementation. void AnimationProgressed(const Animation* animation); diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc index c74e333..f4132bb 100644 --- a/chrome/browser/views/browser_actions_container.cc +++ b/chrome/browser/views/browser_actions_container.cc @@ -952,7 +952,7 @@ void BrowserActionsContainer::BrowserActionAdded(Extension* extension, // in the header for why we do this. suppress_chevron_ = !chevron_->IsVisible(); - Animate(SlideAnimation::NONE, target_size); + Animate(Tween::LINEAR, target_size); } } @@ -990,7 +990,7 @@ void BrowserActionsContainer::BrowserActionRemoved(Extension* extension) { int target_size = ClampToNearestIconCount(IconCountToWidth(visible_actions), true); - Animate(SlideAnimation::EASE_OUT, target_size); + Animate(Tween::EASE_OUT, target_size); return; } } @@ -1048,8 +1048,7 @@ int BrowserActionsContainer::ContainerMinSize() const { return resize_gripper_->width() + chevron_->width() + kChevronRightMargin; } -void BrowserActionsContainer::Animate( - SlideAnimation::TweenType tween_type, int target_size) { +void BrowserActionsContainer::Animate(Tween::Type tween_type, int target_size) { if (!disable_animations_during_testing_) { // Animate! We have to set the animation_target_size_ after calling Reset(), // because that could end up calling AnimationEnded which clears the value. @@ -1093,7 +1092,7 @@ void BrowserActionsContainer::OnResize(int resize_amount, bool done_resizing) { container_size_.set_width(new_width); animation_target_size_ = ClampToNearestIconCount(new_width, true); resize_animation_->Reset(); - resize_animation_->SetTweenType(SlideAnimation::EASE_OUT); + resize_animation_->SetTweenType(Tween::EASE_OUT); resize_animation_->Show(); } } diff --git a/chrome/browser/views/browser_actions_container.h b/chrome/browser/views/browser_actions_container.h index ac263ef..a4334f3 100644 --- a/chrome/browser/views/browser_actions_container.h +++ b/chrome/browser/views/browser_actions_container.h @@ -428,7 +428,7 @@ class BrowserActionsContainer // Animate to the target value (unless testing, in which case we go straight // to the target size). - void Animate(SlideAnimation::TweenType tween_type, int target_size); + void Animate(Tween::Type type, int target_size); // Returns true if this extension should be shown in this toolbar. This can // return false if we are in an incognito window and the extension is disabled diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index 4ae499e..b38f4e7 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -359,7 +359,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) { StopDownloadProgress(); complete_animation_.reset(new SlideAnimation(this)); complete_animation_->SetSlideDuration(kCompleteAnimationDurationMs); - complete_animation_->SetTweenType(SlideAnimation::NONE); + complete_animation_->SetTweenType(Tween::LINEAR); complete_animation_->Show(); if (status_text.empty()) show_status_text_ = false; @@ -655,7 +655,7 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { download_util::SMALL); } else if (download_->state() == DownloadItem::COMPLETE && complete_animation_.get() && - complete_animation_->IsAnimating()) { + complete_animation_->is_animating()) { download_util::PaintDownloadComplete(canvas, this, 0, 0, complete_animation_->GetCurrentValue(), download_util::SMALL); @@ -783,7 +783,7 @@ bool DownloadItemView::OnMousePressed(const views::MouseEvent& event) { return true; // Stop any completion animation. - if (complete_animation_.get() && complete_animation_->IsAnimating()) + if (complete_animation_.get() && complete_animation_->is_animating()) complete_animation_->End(); if (event.IsOnlyLeftMouseButton()) { diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc index ff6346d..d727d43 100644 --- a/chrome/browser/views/download_shelf_view.cc +++ b/chrome/browser/views/download_shelf_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -165,7 +165,7 @@ gfx::Size DownloadShelfView::GetPreferredSize() { prefsize.Enlarge(kDownloadPadding, 0); } prefsize.Enlarge(0, kTopBottomPadding + kTopBottomPadding); - if (shelf_animation_->IsAnimating()) { + if (shelf_animation_->is_animating()) { prefsize.set_height(static_cast<int>( static_cast<double>(prefsize.height()) * shelf_animation_->GetCurrentValue())); @@ -252,7 +252,7 @@ void DownloadShelfView::Layout() { // Figure out width of item. int item_width = view_size.width(); - if (new_item_animation_->IsAnimating() && ri == download_views_.rbegin()) { + if (new_item_animation_->is_animating() && ri == download_views_.rbegin()) { item_width = static_cast<int>(static_cast<double>(view_size.width()) * new_item_animation_->GetCurrentValue()); } diff --git a/chrome/browser/views/download_started_animation_win.cc b/chrome/browser/views/download_started_animation_win.cc index 8f05c46..eb63f1c 100644 --- a/chrome/browser/views/download_started_animation_win.cc +++ b/chrome/browser/views/download_started_animation_win.cc @@ -4,7 +4,7 @@ #include "chrome/browser/download/download_started_animation.h" -#include "app/animation.h" +#include "app/linear_animation.h" #include "app/resource_bundle.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/notification_registrar.h" @@ -32,7 +32,7 @@ namespace { // provided on the constructor, while simultaneously fading it out. To use, // simply call "new DownloadStartAnimation"; the class cleans itself up when it // finishes animating. -class DownloadStartedAnimationWin : public Animation, +class DownloadStartedAnimationWin : public LinearAnimation, public NotificationObserver, public views::ImageView { public: @@ -74,7 +74,7 @@ class DownloadStartedAnimationWin : public Animation, DownloadStartedAnimationWin::DownloadStartedAnimationWin( TabContents* tab_contents) - : Animation(kMoveTimeMs, kFrameRateHz, NULL), + : LinearAnimation(kMoveTimeMs, kFrameRateHz, NULL), popup_(NULL), tab_contents_(tab_contents) { static SkBitmap* kDownloadImage = NULL; diff --git a/chrome/browser/views/dropdown_bar_host.cc b/chrome/browser/views/dropdown_bar_host.cc index e16074c..b722979 100644 --- a/chrome/browser/views/dropdown_bar_host.cc +++ b/chrome/browser/views/dropdown_bar_host.cc @@ -92,7 +92,7 @@ void DropdownBarHost::SetFocusAndSelection() { } bool DropdownBarHost::IsAnimating() const { - return animation_->IsAnimating(); + return animation_->is_animating(); } void DropdownBarHost::Hide(bool animate) { diff --git a/chrome/browser/views/extensions/extension_shelf.cc b/chrome/browser/views/extensions/extension_shelf.cc index 571e21d..e06b494 100644 --- a/chrome/browser/views/extensions/extension_shelf.cc +++ b/chrome/browser/views/extensions/extension_shelf.cc @@ -434,7 +434,7 @@ void ExtensionShelf::Toolstrip::LayoutWindow() { } gfx::Size window_size = GetPreferredSize(); - if (mole_animation_->IsAnimating()) { + if (mole_animation_->is_animating()) { // We only want to animate the body of the mole window. When we're // expanding, this is everything except for the handle. When we're // collapsing, this is everything except for the handle and the toolstrip. @@ -455,7 +455,7 @@ void ExtensionShelf::Toolstrip::LayoutWindow() { // Now figure out where to place the window on the screen. Since it's a top- // level widget, we need to do some coordinate conversion to get this right. gfx::Point origin(-kToolstripPadding, 0); - if (expanded_ || mole_animation_->IsAnimating()) { + if (expanded_ || mole_animation_->is_animating()) { origin.set_y(GetShelfView()->height() - window_size.height()); views::View::ConvertPointToView(GetShelfView(), shelf_->GetRootView(), &origin); @@ -665,7 +665,7 @@ void ExtensionShelf::Toolstrip::ShowShelfHandle() { void ExtensionShelf::Toolstrip::HideShelfHandle(int delay_ms) { StopHandleTimer(); - if (!handle_visible() || dragging_ || mole_animation_->IsAnimating()) + if (!handle_visible() || dragging_ || mole_animation_->is_animating()) return; if (delay_ms) { MessageLoop::current()->PostDelayedTask(FROM_HERE, diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 203b921..ade9dc0 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -890,10 +890,7 @@ bool BrowserView::IsBookmarkBarVisible() const { } bool BrowserView::IsBookmarkBarAnimating() const { - if (bookmark_bar_view_.get() && - bookmark_bar_view_->IsAnimating()) - return true; - return false; + return bookmark_bar_view_.get() && bookmark_bar_view_->is_animating(); } bool BrowserView::IsToolbarVisible() const { diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index dd4354e..ead3d97 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -136,7 +136,7 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) AddChildView(close_button_); animation_.reset(new SlideAnimation(this)); - animation_->SetTweenType(SlideAnimation::NONE); + animation_->SetTweenType(Tween::LINEAR); } InfoBar::~InfoBar() { diff --git a/chrome/browser/views/infobars/translate_infobars.cc b/chrome/browser/views/infobars/translate_infobars.cc index 3bebe90..7cc9f11 100644 --- a/chrome/browser/views/infobars/translate_infobars.cc +++ b/chrome/browser/views/infobars/translate_infobars.cc @@ -261,7 +261,7 @@ TranslateInfoBar::TranslateInfoBar(TranslateInfoBarDelegate* delegate) // Initialize slide animation for transitioning to and from error state. error_animation_.reset(new SlideAnimation(this)); - error_animation_->SetTweenType(SlideAnimation::NONE); + error_animation_->SetTweenType(Tween::LINEAR); error_animation_->SetSlideDuration(500); // Initialize icon. @@ -564,7 +564,7 @@ void TranslateInfoBar::Layout() { void TranslateInfoBar::PaintBackground(gfx::Canvas* canvas) { // If we're not animating, simply paint background for current state. - if (!error_animation_->IsAnimating()) { + if (!error_animation_->is_animating()) { GetBackground(state_)->Paint(canvas, this); return; } diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc index ff874f2..a44ef96 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) { diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index 6b9306e..adf9a2b 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -71,7 +71,7 @@ DraggedTabView::DraggedTabView(TabContents* datasource, } DraggedTabView::~DraggedTabView() { - if (close_animation_.IsAnimating()) + if (close_animation_.is_animating()) close_animation_.Stop(); GetParent()->RemoveChildView(this); container_->CloseNow(); @@ -154,7 +154,7 @@ void DraggedTabView::AnimateToBounds(const gfx::Rect& bounds, animation_end_bounds_ = bounds; close_animation_.SetSlideDuration(kAnimateToBoundsDurationMs); - close_animation_.SetTweenType(SlideAnimation::EASE_OUT); + close_animation_.SetTweenType(Tween::EASE_OUT); if (!close_animation_.IsShowing()) { close_animation_.Reset(); close_animation_.Show(); diff --git a/chrome/browser/views/tabs/side_tab.cc b/chrome/browser/views/tabs/side_tab.cc index dfa18e1..54795fb 100644 --- a/chrome/browser/views/tabs/side_tab.cc +++ b/chrome/browser/views/tabs/side_tab.cc @@ -165,7 +165,7 @@ void SideTab::Paint(gfx::Canvas* canvas) { SkPaint paint; SkAlpha opacity = kBackgroundTabAlpha; - if (hover_animation_->IsAnimating()) + if (hover_animation_->is_animating()) opacity = static_cast<SkAlpha>(hover_animation_->GetCurrentValue() * 255); paint.setColor(SkColorSetARGB(kBackgroundTabAlpha, 255, 255, 255)); @@ -181,12 +181,12 @@ gfx::Size SideTab::GetPreferredSize() { } void SideTab::OnMouseEntered(const views::MouseEvent& event) { - hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); + hover_animation_->SetTweenType(Tween::EASE_OUT); hover_animation_->Show(); } void SideTab::OnMouseExited(const views::MouseEvent& event) { - hover_animation_->SetTweenType(SlideAnimation::EASE_IN); + hover_animation_->SetTweenType(Tween::EASE_IN); hover_animation_->Hide(); } diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 8b5a1d8..13aeff9 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -222,11 +222,11 @@ class TabCloseButton : public views::ImageButton { // FaviconCrashAnimation // // A custom animation subclass to manage the favicon crash animation. -class TabRenderer::FavIconCrashAnimation : public Animation, +class TabRenderer::FavIconCrashAnimation : public LinearAnimation, public AnimationDelegate { public: explicit FavIconCrashAnimation(TabRenderer* target) - : ALLOW_THIS_IN_INITIALIZER_LIST(Animation(1000, 25, this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(LinearAnimation(1000, 25, this)), target_(target) { } virtual ~FavIconCrashAnimation() {} @@ -394,8 +394,7 @@ void TabRenderer::StartPulse() { } void TabRenderer::StopPulse() { - if (pulse_animation_->IsAnimating()) - pulse_animation_->Stop(); + pulse_animation_->Stop(); } void TabRenderer::StartMiniTabTitleAnimation() { @@ -404,7 +403,7 @@ void TabRenderer::StartMiniTabTitleAnimation() { mini_title_animation_->SetThrobDuration(kMiniTitleChangeThrobDuration); } - if (!mini_title_animation_->IsAnimating()) { + if (!mini_title_animation_->is_animating()) { mini_title_animation_->StartThrobbing(2); } else if (mini_title_animation_->cycles_remaining() <= 2) { // The title changed while we're already animating. Add at most one more @@ -449,7 +448,7 @@ void TabRenderer::PaintIcon(gfx::Canvas* canvas) { // effect separately. int size = data_.favicon.width(); if (mini() && mini_title_animation_.get() && - mini_title_animation_->IsAnimating()) { + mini_title_animation_->is_animating()) { int throb_size = mini_title_animation_->CurrentValueBetween( size, kMiniTitleChangeMaxFaviconSize); x -= (throb_size - size) / 2; @@ -507,12 +506,12 @@ std::wstring TabRenderer::GetTitle() const { } void TabRenderer::OnMouseEntered(const views::MouseEvent& e) { - hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); + hover_animation_->SetTweenType(Tween::EASE_OUT); hover_animation_->Show(); } void TabRenderer::OnMouseExited(const views::MouseEvent& e) { - hover_animation_->SetTweenType(SlideAnimation::EASE_IN); + hover_animation_->SetTweenType(Tween::EASE_IN); hover_animation_->Hide(); } @@ -930,7 +929,7 @@ double TabRenderer::GetThrobValue() { if (data_.alpha != 1) return data_.alpha; - if (pulse_animation_->IsAnimating()) + if (pulse_animation_->is_animating()) return pulse_animation_->GetCurrentValue() * kHoverOpacity; return hover_animation_.get() ? @@ -954,7 +953,7 @@ void TabRenderer::StopCrashAnimation() { } bool TabRenderer::IsPerformingCrashAnimation() const { - return crash_animation_ && crash_animation_->IsAnimating(); + return crash_animation_ && crash_animation_->is_animating(); } void TabRenderer::SetFavIconHidingOffset(int offset) { diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index a6e11d3..ced65ab 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -1529,7 +1529,7 @@ void TabStrip::NewTabAnimation2Done() { SlideAnimation* animation = new SlideAnimation(NULL); animation->SetSlideDuration(kNewTab3DurationMs); - animation->SetTweenType(SlideAnimation::EASE_IN_OUT); + animation->SetTweenType(Tween::EASE_IN_OUT); // BoundsAnimator takes ownership of animation. bounds_animator_.SetAnimationForView(tab_data_.back().tab, animation); |