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

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

Issue 8588068: GTK: Create the start of a compatibility header wrapping deprecated methods. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to ToT and remove views/ cleanups. Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/gtk/hover_controller_gtk.h" 5 #include "chrome/browser/ui/gtk/hover_controller_gtk.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" 8 #include "chrome/browser/ui/gtk/gtk_chrome_button.h"
9 #include "ui/base/gtk/gtk_compat.h"
9 10
10 static const gchar* kHoverControllerGtkKey = "__HOVER_CONTROLLER_GTK__"; 11 static const gchar* kHoverControllerGtkKey = "__HOVER_CONTROLLER_GTK__";
11 12
12 HoverControllerGtk::HoverControllerGtk(GtkWidget* button) 13 HoverControllerGtk::HoverControllerGtk(GtkWidget* button)
13 : throb_animation_(this), 14 : throb_animation_(this),
14 hover_animation_(this), 15 hover_animation_(this),
15 button_(button) { 16 button_(button) {
16 g_object_ref(button_); 17 g_object_ref(button_);
17 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0); 18 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0);
18 19
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 hover_animation_.Hide(); 108 hover_animation_.Hide();
108 } 109 }
109 110
110 return FALSE; 111 return FALSE;
111 } 112 }
112 113
113 void HoverControllerGtk::OnHierarchyChanged(GtkWidget* widget, 114 void HoverControllerGtk::OnHierarchyChanged(GtkWidget* widget,
114 GtkWidget* previous_toplevel) { 115 GtkWidget* previous_toplevel) {
115 // GTK+ does not emit leave-notify-event signals when a widget 116 // GTK+ does not emit leave-notify-event signals when a widget
116 // becomes unanchored, so manually unset the hover states. 117 // becomes unanchored, so manually unset the hover states.
117 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(widget))) { 118 if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(widget))) {
118 gtk_widget_set_state(button_, GTK_STATE_NORMAL); 119 gtk_widget_set_state(button_, GTK_STATE_NORMAL);
119 hover_animation_.Reset(); 120 hover_animation_.Reset();
120 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0.0); 121 gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0.0);
121 } 122 }
122 } 123 }
123 124
124 void HoverControllerGtk::OnDestroy(GtkWidget* widget) { 125 void HoverControllerGtk::OnDestroy(GtkWidget* widget) {
125 Destroy(); 126 Destroy();
126 } 127 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_util.cc ('k') | chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698