summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 01:03:37 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 01:03:37 +0000
commit32d8383bc71b0f2652287081c54b9acee911bd57 (patch)
treeb3579eea8561c94bb505f7c096e10632b4d69628
parentdbaae79fc18a7de4bdebe031d9021b6204d91059 (diff)
downloadchromium_src-32d8383bc71b0f2652287081c54b9acee911bd57.zip
chromium_src-32d8383bc71b0f2652287081c54b9acee911bd57.tar.gz
chromium_src-32d8383bc71b0f2652287081c54b9acee911bd57.tar.bz2
GTK: Add hover effects for GtkChromeButtons.
Similar to the previous patch for CustomButtons. BUG=36760 TEST=manual Review URL: http://codereview.chromium.org/676001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40979 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc23
-rw-r--r--chrome/browser/gtk/browser_actions_toolbar_gtk.cc16
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.cc7
-rw-r--r--chrome/browser/gtk/custom_button.cc2
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc9
-rw-r--r--chrome/browser/gtk/hover_controller_gtk.cc114
-rw-r--r--chrome/browser/gtk/hover_controller_gtk.h74
-rw-r--r--chrome/browser/gtk/throb_controller_gtk.cc94
-rw-r--r--chrome/browser/gtk/throb_controller_gtk.h68
-rwxr-xr-xchrome/chrome_browser.gypi4
-rw-r--r--chrome/common/owned_widget_gtk.cc4
11 files changed, 220 insertions, 195 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 91339b7..19fe0b2 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -26,12 +26,12 @@
#include "chrome/browser/gtk/gtk_chrome_button.h"
#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/gtk/gtk_util.h"
+#include "chrome/browser/gtk/hover_controller_gtk.h"
#include "chrome/browser/gtk/import_dialog_gtk.h"
#include "chrome/browser/gtk/menu_gtk.h"
#include "chrome/browser/gtk/rounded_window.h"
#include "chrome/browser/gtk/tabstrip_origin_provider.h"
#include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
-#include "chrome/browser/gtk/throb_controller_gtk.h"
#include "chrome/browser/gtk/view_id_util.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/ntp_background_util.h"
@@ -750,10 +750,10 @@ void BookmarkBarGtk::StartThrobbing(const BookmarkNode* node) {
void BookmarkBarGtk::SetThrobbingWidget(GtkWidget* widget) {
if (throbbing_widget_) {
- ThrobControllerGtk* throbber =
- ThrobControllerGtk::GetThrobControllerGtk(throbbing_widget_);
- if (throbber)
- throbber->Destroy();
+ HoverControllerGtk* hover_controller =
+ HoverControllerGtk::GetHoverControllerGtk(throbbing_widget_);
+ if (hover_controller)
+ hover_controller->StartThrobbing(0);
g_signal_handlers_disconnect_by_func(
throbbing_widget_,
@@ -769,7 +769,10 @@ void BookmarkBarGtk::SetThrobbingWidget(GtkWidget* widget) {
g_signal_connect(throbbing_widget_, "destroy",
G_CALLBACK(OnThrobbingWidgetDestroy), this);
- ThrobControllerGtk::ThrobFor(throbbing_widget_, 4);
+ HoverControllerGtk* hover_controller =
+ HoverControllerGtk::GetHoverControllerGtk(throbbing_widget_);
+ if (hover_controller)
+ hover_controller->StartThrobbing(4);
}
}
@@ -1054,10 +1057,10 @@ void BookmarkBarGtk::OnButtonDragGet(GtkWidget* widget, GdkDragContext* context,
void BookmarkBarGtk::OnFolderClicked(GtkWidget* sender,
BookmarkBarGtk* bar) {
// Stop its throbbing, if any.
- ThrobControllerGtk* throbber =
- ThrobControllerGtk::GetThrobControllerGtk(sender);
- if (throbber)
- throbber->Destroy();
+ HoverControllerGtk* hover_controller =
+ HoverControllerGtk::GetHoverControllerGtk(sender);
+ if (hover_controller)
+ hover_controller->StartThrobbing(0);
GdkEvent* event = gtk_get_current_event();
if (event->button.button == 1) {
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
index 6ff99cf..dcea49d 100644
--- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
@@ -57,10 +57,12 @@ class BrowserActionButton : public NotificationObserver,
Extension* extension)
: toolbar_(toolbar),
extension_(extension),
- button_(gtk_chrome_button_new()),
tracker_(NULL),
tab_specific_icon_(NULL),
default_icon_(NULL) {
+ button_.Own(
+ GtkThemeProvider::GetFrom(toolbar->profile_)->BuildChromeButton());
+
DCHECK(extension_->browser_action());
gtk_widget_set_size_request(button_.get(), kButtonSize, kButtonSize);
@@ -88,10 +90,6 @@ class BrowserActionButton : public NotificationObserver,
registrar_.Add(this, NotificationType::EXTENSION_BROWSER_ACTION_UPDATED,
Source<ExtensionAction>(extension->browser_action()));
- registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED,
- NotificationService::AllSources());
-
- OnThemeChanged();
}
~BrowserActionButton() {
@@ -117,8 +115,6 @@ class BrowserActionButton : public NotificationObserver,
const NotificationDetails& details) {
if (type == NotificationType::EXTENSION_BROWSER_ACTION_UPDATED)
UpdateState();
- else if (type == NotificationType::BROWSER_THEME_CHANGED)
- OnThemeChanged();
else
NOTREACHED();
}
@@ -163,12 +159,6 @@ class BrowserActionButton : public NotificationObserver,
gtk_image_new_from_pixbuf(image));
}
- void OnThemeChanged() {
- gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(button_.get()),
- GtkThemeProvider::GetFrom(
- toolbar_->browser()->profile())->UseGtkTheme());
- }
-
static gboolean OnButtonPress(GtkWidget* widget,
GdkEvent* event,
BrowserActionButton* action) {
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc
index 08ef507..030a18d 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_toolbar_gtk.cc
@@ -330,6 +330,13 @@ void BrowserToolbarGtk::EnabledStateChangedForCommand(int id, bool enabled) {
// MenuGtk::Delegate -----------------------------------------------------------
void BrowserToolbarGtk::StoppedShowing() {
+ // Without these calls, the hover state can get stuck since the leave-notify
+ // event is not sent when clicking a button brings up the menu.
+ gtk_chrome_button_set_hover_state(
+ GTK_CHROME_BUTTON(page_menu_button_.get()), 0.0);
+ gtk_chrome_button_set_hover_state(
+ GTK_CHROME_BUTTON(app_menu_button_.get()), 0.0);
+
gtk_chrome_button_unset_paint_state(
GTK_CHROME_BUTTON(page_menu_button_.get()));
gtk_chrome_button_unset_paint_state(
diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc
index 5a591d3..1c2fe35 100644
--- a/chrome/browser/gtk/custom_button.cc
+++ b/chrome/browser/gtk/custom_button.cc
@@ -210,7 +210,7 @@ gboolean CustomDrawHoverController::OnLeave(
GtkWidget* widget,
GdkEventCrossing* event,
CustomDrawHoverController* controller) {
- // When the user is holding a mouse button, we don't want to animste.
+ // When the user is holding a mouse button, we don't want to animate.
if (event->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK))
controller->slide_animation_.Reset();
else
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 111b237..db9de14 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/gtk/cairo_cached_surface.h"
+#include "chrome/browser/gtk/hover_controller_gtk.h"
#include "chrome/browser/gtk/gtk_chrome_button.h"
#include "chrome/browser/gtk/meta_frames.h"
#include "chrome/browser/pref_service.h"
@@ -206,7 +207,7 @@ void GtkThemeProvider::Observe(NotificationType type,
}
GtkWidget* GtkThemeProvider::BuildChromeButton() {
- GtkWidget* button = gtk_chrome_button_new();
+ GtkWidget* button = HoverControllerGtk::CreateChromeButton();
gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(button), use_gtk_);
chrome_buttons_.push_back(button);
@@ -622,9 +623,9 @@ void GtkThemeProvider::LoadGtkValues() {
void GtkThemeProvider::LoadDefaultValues() {
focus_ring_color_ = SkColorSetARGB(255, 229, 151, 0);
- thumb_active_color_ = SkColorSetRGB(250, 248, 245);
- thumb_inactive_color_ = SkColorSetRGB(240, 235, 229);
- track_color_ = SkColorSetRGB(227, 221, 216);
+ thumb_active_color_ = SkColorSetRGB(244, 244, 244);
+ thumb_inactive_color_ = SkColorSetRGB(234, 234, 234);
+ track_color_ = SkColorSetRGB(211, 211, 211);
active_selection_bg_color_ = SkColorSetRGB(30, 144, 255);
active_selection_fg_color_ = SK_ColorBLACK;
diff --git a/chrome/browser/gtk/hover_controller_gtk.cc b/chrome/browser/gtk/hover_controller_gtk.cc
new file mode 100644
index 0000000..0be9da9
--- /dev/null
+++ b/chrome/browser/gtk/hover_controller_gtk.cc
@@ -0,0 +1,114 @@
+// 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.
+
+#include "chrome/browser/gtk/hover_controller_gtk.h"
+
+#include "base/message_loop.h"
+#include "chrome/browser/gtk/gtk_chrome_button.h"
+
+static const gchar* kHoverControllerGtkKey = "__HOVER_CONTROLLER_GTK__";
+
+HoverControllerGtk::HoverControllerGtk(GtkWidget* button)
+ : throb_animation_(this),
+ hover_animation_(this),
+ button_(button) {
+ g_object_ref(button_);
+ gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0);
+
+ g_signal_connect(button_, "enter-notify-event",
+ G_CALLBACK(OnEnterThunk), this);
+ g_signal_connect(button_, "leave-notify-event",
+ G_CALLBACK(OnLeaveThunk), this);
+ g_signal_connect(button_, "destroy",
+ G_CALLBACK(OnButtonDestroyThunk), this);
+
+#ifndef NDEBUG
+ if (g_object_get_data(G_OBJECT(button_), kHoverControllerGtkKey))
+ NOTREACHED();
+#endif // !NDEBUG
+
+ g_object_set_data(G_OBJECT(button), kHoverControllerGtkKey, this);
+}
+
+HoverControllerGtk::~HoverControllerGtk() {
+}
+
+void HoverControllerGtk::StartThrobbing(int cycles) {
+ throb_animation_.StartThrobbing(cycles);
+}
+
+// static
+GtkWidget* HoverControllerGtk::CreateChromeButton() {
+ GtkWidget* widget = gtk_chrome_button_new();
+ new HoverControllerGtk(widget);
+ return widget;
+}
+
+// static
+HoverControllerGtk* HoverControllerGtk::GetHoverControllerGtk(
+ GtkWidget* button) {
+ return reinterpret_cast<HoverControllerGtk*>(
+ g_object_get_data(G_OBJECT(button), kHoverControllerGtkKey));
+}
+
+void HoverControllerGtk::Destroy() {
+ gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), -1.0);
+ g_signal_handlers_disconnect_by_func(
+ button_,
+ reinterpret_cast<gpointer>(OnButtonDestroyThunk),
+ this);
+ g_object_set_data(G_OBJECT(button_), kHoverControllerGtkKey, NULL);
+ g_object_unref(button_);
+ button_ = NULL;
+
+ delete this;
+}
+
+void HoverControllerGtk::AnimationProgressed(const Animation* animation) {
+ if (!button_)
+ return;
+
+ // Ignore the hover animation if we are throbbing.
+ if (animation == &hover_animation_ && throb_animation_.IsAnimating())
+ return;
+
+ gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_),
+ animation->GetCurrentValue());
+}
+
+void HoverControllerGtk::AnimationEnded(const Animation* animation) {
+ if (!button_)
+ return;
+ if (animation != &throb_animation_)
+ return;
+
+ if (throb_animation_.cycles_remaining() <= 1)
+ gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0);
+}
+
+void HoverControllerGtk::AnimationCanceled(const Animation* animation) {
+ AnimationEnded(animation);
+}
+
+gboolean HoverControllerGtk::OnEnter(GtkWidget* widget,
+ GdkEventCrossing* event) {
+ hover_animation_.Show();
+
+ return FALSE;
+}
+
+gboolean HoverControllerGtk::OnLeave(GtkWidget* widget,
+ GdkEventCrossing* event) {
+ // When the user is holding a mouse button, we don't want to animate.
+ if (event->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK))
+ hover_animation_.Reset();
+ else
+ hover_animation_.Hide();
+
+ return FALSE;
+}
+
+void HoverControllerGtk::OnButtonDestroy(GtkWidget* widget) {
+ Destroy();
+}
diff --git a/chrome/browser/gtk/hover_controller_gtk.h b/chrome/browser/gtk/hover_controller_gtk.h
new file mode 100644
index 0000000..6867503
--- /dev/null
+++ b/chrome/browser/gtk/hover_controller_gtk.h
@@ -0,0 +1,74 @@
+// 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.
+
+#ifndef CHROME_BROWSER_GTK_HOVER_CONTROLLER_GTK_H_
+#define CHROME_BROWSER_GTK_HOVER_CONTROLLER_GTK_H_
+
+#include <gtk/gtk.h>
+
+#include "app/slide_animation.h"
+#include "app/throb_animation.h"
+#include "base/scoped_ptr.h"
+
+// This class handles the "throbbing" of a GtkChromeButton. The visual effect
+// of throbbing is created by painting partially transparent hover effects. It
+// only works in non-gtk theme mode. This class mainly exists to glue an
+// AnimationDelegate (C++ class) to a GtkChromeButton* (GTK/c object).
+class HoverControllerGtk : public AnimationDelegate {
+ public:
+ virtual ~HoverControllerGtk();
+
+ GtkWidget* button() { return button_; }
+
+ // Throb for |cycles| cycles. This will override the current remaining
+ // number of cycles. Note that a "cycle" is (somewhat unintuitively) half of
+ // a complete throb revolution.
+ void StartThrobbing(int cycles);
+
+ // Get the HoverControllerGtk for a given GtkChromeButton*. It is an error
+ // to call this on a widget that is not a GtkChromeButton*.
+ static HoverControllerGtk* GetHoverControllerGtk(GtkWidget* button);
+
+ // Creates a GtkChromeButton and adds a HoverControllerGtk for it.
+ static GtkWidget* CreateChromeButton();
+
+ // Stop throbbing and delete |this|.
+ void Destroy();
+
+ private:
+ explicit HoverControllerGtk(GtkWidget* button);
+
+ // Overridden from AnimationDelegate.
+ virtual void AnimationProgressed(const Animation* animation);
+ virtual void AnimationEnded(const Animation* animation);
+ virtual void AnimationCanceled(const Animation* animation);
+
+ static gboolean OnEnterThunk(GtkWidget* widget,
+ GdkEventCrossing* event,
+ HoverControllerGtk* hover_controller) {
+ return hover_controller->OnEnter(widget, event);
+ }
+ gboolean OnEnter(GtkWidget* widget, GdkEventCrossing* event);
+
+ static gboolean OnLeaveThunk(GtkWidget* widget,
+ GdkEventCrossing* event,
+ HoverControllerGtk* hover_controller) {
+ return hover_controller->OnLeave(widget, event);
+ }
+ gboolean OnLeave(GtkWidget* widget, GdkEventCrossing* event);
+
+ static void OnButtonDestroyThunk(GtkWidget* widget,
+ HoverControllerGtk* hover_controller) {
+ hover_controller->OnButtonDestroy(widget);
+ }
+ void OnButtonDestroy(GtkWidget* widget);
+
+ ThrobAnimation throb_animation_;
+ SlideAnimation hover_animation_;
+ GtkWidget* button_;
+
+ DISALLOW_COPY_AND_ASSIGN(HoverControllerGtk);
+};
+
+#endif // CHROME_BROWSER_GTK_HOVER_CONTROLLER_GTK_H_
diff --git a/chrome/browser/gtk/throb_controller_gtk.cc b/chrome/browser/gtk/throb_controller_gtk.cc
deleted file mode 100644
index 33cd9d2..0000000
--- a/chrome/browser/gtk/throb_controller_gtk.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// 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.
-
-#include "chrome/browser/gtk/throb_controller_gtk.h"
-
-#include "base/message_loop.h"
-#include "chrome/browser/gtk/gtk_chrome_button.h"
-
-static const gchar* kThrobControllerGtkKey = "__THROB_CONTROLLER_GTK__";
-
-ThrobControllerGtk::ThrobControllerGtk(GtkWidget* button)
- : animation_(this),
- button_(button) {
- g_object_ref(button_);
- g_signal_connect(button_, "destroy", G_CALLBACK(OnButtonDestroy), this);
-
-#ifndef NDEBUG
- if (g_object_get_data(G_OBJECT(button_), kThrobControllerGtkKey))
- NOTREACHED();
-#endif // !NDEBUG
-
- g_object_set_data(G_OBJECT(button), kThrobControllerGtkKey, this);
-}
-
-ThrobControllerGtk::~ThrobControllerGtk() {
-}
-
-void ThrobControllerGtk::StartThrobbing(int cycles) {
- animation_.StartThrobbing(cycles);
-}
-
-// static
-ThrobControllerGtk* ThrobControllerGtk::GetThrobControllerGtk(
- GtkWidget* button) {
- return reinterpret_cast<ThrobControllerGtk*>(
- g_object_get_data(G_OBJECT(button), kThrobControllerGtkKey));
-}
-
-// static
-void ThrobControllerGtk::ThrobFor(GtkWidget* button, int cycles) {
- if (!GTK_IS_CHROME_BUTTON(button)) {
- NOTREACHED();
- return;
- }
-
- (new ThrobControllerGtk(button))->StartThrobbing(cycles);
-}
-
-void ThrobControllerGtk::Destroy() {
- gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), -1.0);
- g_signal_handlers_disconnect_by_func(
- button_,
- reinterpret_cast<gpointer>(OnButtonDestroy),
- this);
- g_object_set_data(G_OBJECT(button_), kThrobControllerGtkKey, NULL);
- g_object_unref(button_);
- button_ = NULL;
-
- // Since this can be called from within AnimationEnded(), which is called
- // while ThrobAnimation is still doing work, we need to let the stack unwind
- // before |animation_| gets deleted.
- MessageLoop::current()->DeleteSoon(FROM_HERE, this);
-}
-
-void ThrobControllerGtk::AnimationProgressed(const Animation* animation) {
- if (!button_)
- return;
-
- gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_),
- animation->GetCurrentValue());
-}
-
-void ThrobControllerGtk::AnimationEnded(const Animation* animation) {
- if (!button_)
- return;
-
- if (animation_.cycles_remaining() <= 1)
- Destroy();
-}
-
-void ThrobControllerGtk::AnimationCanceled(const Animation* animation) {
- if (!button_)
- return;
-
- if (animation_.cycles_remaining() <= 1)
- Destroy();
-}
-
-// static
-void ThrobControllerGtk::OnButtonDestroy(GtkWidget* widget,
- ThrobControllerGtk* button) {
- button->Destroy();
-}
diff --git a/chrome/browser/gtk/throb_controller_gtk.h b/chrome/browser/gtk/throb_controller_gtk.h
deleted file mode 100644
index fa96e86..0000000
--- a/chrome/browser/gtk/throb_controller_gtk.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// 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.
-
-#ifndef CHROME_BROWSER_GTK_THROB_CONTROLLER_GTK_H_
-#define CHROME_BROWSER_GTK_THROB_CONTROLLER_GTK_H_
-
-#include "app/throb_animation.h"
-#include "base/scoped_ptr.h"
-
-typedef struct _GtkWidget GtkWidget;
-
-// This class handles the "throbbing" of a GtkChromeButton. The visual effect
-// of throbbing is created by painting partially transparent hover effects. It
-// only works in non-gtk theme mode. This class mainly exists to glue an
-// AnimationDelegate (C++ class) to a GtkChromeButton* (GTK/c object). Usage is
-// as follows:
-//
-// GtkWidget* button = gtk_chrome_button_new();
-// ThrobControllerGtk::ThrobFor(button);
-//
-// The ThrobFor() function will handle creation of the ThrobControllerGtk
-// object, which will delete itself automatically when the throbbing is done,
-// or when the widget is destroyed. It may also be canceled prematurely with
-//
-// ThrobControllerGtk* throbber =
-// ThrobControllerGtk::GetThrobControllerGtk(button);
-// throbber->Destroy();
-class ThrobControllerGtk : public AnimationDelegate {
- public:
- virtual ~ThrobControllerGtk();
-
- GtkWidget* button() { return button_; }
-
- // Throb for |cycles| cycles. This will override the current remaining
- // number of cycles. Note that a "cycle" is (somewhat unintuitively) half of
- // a complete throb revolution.
- void StartThrobbing(int cycles);
-
- // Get the ThrobControllerGtk for a given GtkChromeButton*. It is an error
- // to call this on a widget that is not a GtkChromeButton*.
- static ThrobControllerGtk* GetThrobControllerGtk(GtkWidget* button);
-
- // Make |button| throb for |cycles| cycles. It is an error to try to have
- // two ThrobControllerGtk instances for one GtkChromeButton*.
- static void ThrobFor(GtkWidget* button, int cycles);
-
- // Stop throbbing and delete |this|.
- void Destroy();
-
- private:
- explicit ThrobControllerGtk(GtkWidget* button);
-
- // Overridden from AnimationDelegate.
- virtual void AnimationProgressed(const Animation* animation);
- virtual void AnimationEnded(const Animation* animation);
- virtual void AnimationCanceled(const Animation* animation);
-
- static void OnButtonDestroy(GtkWidget* widget,
- ThrobControllerGtk* button);
-
- ThrobAnimation animation_;
- GtkWidget* button_;
-
- DISALLOW_COPY_AND_ASSIGN(ThrobControllerGtk);
-};
-
-#endif // CHROME_BROWSER_GTK_THROB_CONTROLLER_GTK_H_
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 730f111..d912075 100755
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1140,6 +1140,8 @@
'browser/gtk/gtk_tree.h',
'browser/gtk/gtk_util.cc',
'browser/gtk/gtk_util.h',
+ 'browser/gtk/hover_controller_gtk.cc',
+ 'browser/gtk/hover_controller_gtk.h',
'browser/gtk/html_dialog_gtk.cc',
'browser/gtk/html_dialog_gtk.h',
'browser/gtk/hung_renderer_dialog_gtk.cc',
@@ -1243,8 +1245,6 @@
'browser/gtk/task_manager_gtk.h',
'browser/gtk/theme_install_bubble_view_gtk.cc',
'browser/gtk/theme_install_bubble_view_gtk.h',
- 'browser/gtk/throb_controller_gtk.cc',
- 'browser/gtk/throb_controller_gtk.h',
'browser/gtk/toolbar_star_toggle_gtk.cc',
'browser/gtk/toolbar_star_toggle_gtk.h',
'browser/gtk/view_id_util.cc',
diff --git a/chrome/common/owned_widget_gtk.cc b/chrome/common/owned_widget_gtk.cc
index 6b4f0d5..f9b8bef 100644
--- a/chrome/common/owned_widget_gtk.cc
+++ b/chrome/common/owned_widget_gtk.cc
@@ -15,10 +15,8 @@ OwnedWidgetGtk::~OwnedWidgetGtk() {
void OwnedWidgetGtk::Own(GtkWidget* widget) {
DCHECK(!widget_);
// We want to make sure that Own() was called properly, right after the
- // widget was created. We should have a floating refcount of 1.
+ // widget was created. There should be a floating reference.
DCHECK(g_object_is_floating(widget));
- // NOTE: Assumes some implementation details about glib internals.
- DCHECK(G_OBJECT(widget)->ref_count == 1);
// Sink the floating reference, we should now own this reference.
g_object_ref_sink(widget);