diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 23:12:21 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 23:12:21 +0000 |
commit | ba625918f43f292ef3fbc5563770be7bbfd1f233 (patch) | |
tree | d9c494753b68db3a5b3cc6b015996aa4f063c3ae /chrome/browser | |
parent | 53c003cc3d7beb800eb20c5eda711f9420730054 (diff) | |
download | chromium_src-ba625918f43f292ef3fbc5563770be7bbfd1f233.zip chromium_src-ba625918f43f292ef3fbc5563770be7bbfd1f233.tar.gz chromium_src-ba625918f43f292ef3fbc5563770be7bbfd1f233.tar.bz2 |
fix hover animation regression.
BUG=27119
TEST=None
Review URL: http://codereview.chromium.org/371082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/tabs/tab.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 20 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.h | 6 |
3 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index 7876ae2..c51e240 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -193,6 +193,7 @@ void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) { } void Tab::OnMouseEntered(const views::MouseEvent& event) { + TabRenderer::OnMouseEntered(event); GetBrowserExtender()->OnMouseEnteredToTab(this); } @@ -201,6 +202,7 @@ void Tab::OnMouseMoved(const views::MouseEvent& event) { } void Tab::OnMouseExited(const views::MouseEvent& event) { + TabRenderer::OnMouseExited(event); GetBrowserExtender()->OnMouseExitedFromTab(this); } diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 3bd9422..cdc1488 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -430,6 +430,16 @@ std::wstring TabRenderer::GetTitle() const { return UTF16ToWideHack(data_.title); } +void TabRenderer::OnMouseEntered(const views::MouseEvent& e) { + hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); + hover_animation_->Show(); +} + +void TabRenderer::OnMouseExited(const views::MouseEvent& e) { + hover_animation_->SetTweenType(SlideAnimation::EASE_IN); + hover_animation_->Hide(); +} + //////////////////////////////////////////////////////////////////////////////// // TabRenderer, views::View overrides: @@ -551,16 +561,6 @@ void TabRenderer::Layout() { title_bounds_.set_x(MirroredLeftPointForRect(title_bounds_)); } -void TabRenderer::OnMouseEntered(const views::MouseEvent& e) { - hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); - hover_animation_->Show(); -} - -void TabRenderer::OnMouseExited(const views::MouseEvent& e) { - hover_animation_->SetTweenType(SlideAnimation::EASE_IN); - hover_animation_->Hide(); -} - void TabRenderer::ThemeChanged() { LoadTabImages(); View::ThemeChanged(); diff --git a/chrome/browser/views/tabs/tab_renderer.h b/chrome/browser/views/tabs/tab_renderer.h index cdd8e9c..bf71dfc 100644 --- a/chrome/browser/views/tabs/tab_renderer.h +++ b/chrome/browser/views/tabs/tab_renderer.h @@ -108,6 +108,10 @@ class TabRenderer : public views::View, // Returns the title of the Tab. std::wstring GetTitle() const; + // Overridden from views::View: + virtual void OnMouseEntered(const views::MouseEvent& event); + virtual void OnMouseExited(const views::MouseEvent& event); + // views::ButtonListener overrides: virtual void ButtonPressed(views::Button* sender, const views::Event& event) {} @@ -116,8 +120,6 @@ class TabRenderer : public views::View, // Overridden from views::View: virtual void Paint(gfx::Canvas* canvas); virtual void Layout(); - virtual void OnMouseEntered(const views::MouseEvent& event); - virtual void OnMouseExited(const views::MouseEvent& event); virtual void ThemeChanged(); // Overridden from AnimationDelegate: |