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

Side by Side Diff: chrome/browser/gtk/hover_controller_gtk.cc

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/hover_controller_gtk.h" 5 #include "chrome/browser/gtk/hover_controller_gtk.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/gtk/gtk_chrome_button.h" 8 #include "chrome/browser/gtk/gtk_chrome_button.h"
9 9
10 static const gchar* kHoverControllerGtkKey = "__HOVER_CONTROLLER_GTK__"; 10 static const gchar* kHoverControllerGtkKey = "__HOVER_CONTROLLER_GTK__";
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 button_ = NULL; 60 button_ = NULL;
61 61
62 delete this; 62 delete this;
63 } 63 }
64 64
65 void HoverControllerGtk::AnimationProgressed(const Animation* animation) { 65 void HoverControllerGtk::AnimationProgressed(const Animation* animation) {
66 if (!button_) 66 if (!button_)
67 return; 67 return;
68 68
69 // Ignore the hover animation if we are throbbing. 69 // Ignore the hover animation if we are throbbing.
70 if (animation == &hover_animation_ && throb_animation_.IsAnimating()) 70 if (animation == &hover_animation_ && throb_animation_.is_animating())
71 return; 71 return;
72 72
73 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 73 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_),
74 animation->GetCurrentValue()); 74 animation->GetCurrentValue());
75 } 75 }
76 76
77 void HoverControllerGtk::AnimationEnded(const Animation* animation) { 77 void HoverControllerGtk::AnimationEnded(const Animation* animation) {
78 if (!button_) 78 if (!button_)
79 return; 79 return;
80 if (animation != &throb_animation_) 80 if (animation != &throb_animation_)
(...skipping 23 matching lines...) Expand all
104 } else { 104 } else {
105 hover_animation_.Hide(); 105 hover_animation_.Hide();
106 } 106 }
107 107
108 return FALSE; 108 return FALSE;
109 } 109 }
110 110
111 void HoverControllerGtk::OnDestroy(GtkWidget* widget) { 111 void HoverControllerGtk::OnDestroy(GtkWidget* widget) {
112 Destroy(); 112 Destroy();
113 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/download_started_animation_gtk.cc ('k') | chrome/browser/gtk/slide_animator_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698