| OLD | NEW |
| 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/custom_button.h" | 5 #include "chrome/browser/gtk/custom_button.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/gtk/cairo_cached_surface.h" | 9 #include "chrome/browser/gtk/cairo_cached_surface.h" |
| 10 #include "chrome/browser/gtk/gtk_chrome_button.h" | 10 #include "chrome/browser/gtk/gtk_chrome_button.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 void CustomDrawHoverController::Init(GtkWidget* widget) { | 185 void CustomDrawHoverController::Init(GtkWidget* widget) { |
| 186 DCHECK(widget_ == NULL); | 186 DCHECK(widget_ == NULL); |
| 187 widget_ = widget; | 187 widget_ = widget; |
| 188 g_signal_connect(widget_, "enter-notify-event", | 188 g_signal_connect(widget_, "enter-notify-event", |
| 189 G_CALLBACK(OnEnterThunk), this); | 189 G_CALLBACK(OnEnterThunk), this); |
| 190 g_signal_connect(widget_, "leave-notify-event", | 190 g_signal_connect(widget_, "leave-notify-event", |
| 191 G_CALLBACK(OnLeaveThunk), this); | 191 G_CALLBACK(OnLeaveThunk), this); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void CustomDrawHoverController::AnimationProgressed( | 194 void CustomDrawHoverController::AnimationProgressed( |
| 195 const Animation* animation) { | 195 const ui::Animation* animation) { |
| 196 gtk_widget_queue_draw(widget_); | 196 gtk_widget_queue_draw(widget_); |
| 197 } | 197 } |
| 198 | 198 |
| 199 gboolean CustomDrawHoverController::OnEnter( | 199 gboolean CustomDrawHoverController::OnEnter( |
| 200 GtkWidget* widget, | 200 GtkWidget* widget, |
| 201 GdkEventCrossing* event) { | 201 GdkEventCrossing* event) { |
| 202 slide_animation_.Show(); | 202 slide_animation_.Show(); |
| 203 return FALSE; | 203 return FALSE; |
| 204 } | 204 } |
| 205 | 205 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 gtk_widget_set_app_paintable(widget(), TRUE); | 336 gtk_widget_set_app_paintable(widget(), TRUE); |
| 337 } | 337 } |
| 338 | 338 |
| 339 gtk_chrome_button_set_use_gtk_rendering( | 339 gtk_chrome_button_set_use_gtk_rendering( |
| 340 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); | 340 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); |
| 341 } | 341 } |
| 342 | 342 |
| 343 bool CustomDrawButton::UseGtkTheme() { | 343 bool CustomDrawButton::UseGtkTheme() { |
| 344 return theme_provider_ && theme_provider_->UseGtkTheme(); | 344 return theme_provider_ && theme_provider_->UseGtkTheme(); |
| 345 } | 345 } |
| OLD | NEW |