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/reload_button_gtk.h" | 5 #include "chrome/browser/gtk/reload_button_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 gboolean ReloadButtonGtk::OnExpose(GtkWidget* widget, | 154 gboolean ReloadButtonGtk::OnExpose(GtkWidget* widget, |
155 GdkEventExpose* e) { | 155 GdkEventExpose* e) { |
156 if (theme_provider_ && theme_provider_->UseGtkTheme()) | 156 if (theme_provider_ && theme_provider_->UseGtkTheme()) |
157 return FALSE; | 157 return FALSE; |
158 return ((visible_mode_ == MODE_RELOAD) ? reload_ : stop_).OnExpose( | 158 return ((visible_mode_ == MODE_RELOAD) ? reload_ : stop_).OnExpose( |
159 widget, e, hover_controller_.GetCurrentValue()); | 159 widget, e, hover_controller_.GetCurrentValue()); |
160 } | 160 } |
161 | 161 |
162 gboolean ReloadButtonGtk::OnLeaveNotify(GtkWidget* widget, | 162 gboolean ReloadButtonGtk::OnLeaveNotify(GtkWidget* widget, |
163 GdkEventCrossing* event) { | 163 GdkEventCrossing* event) { |
164 ChangeMode(intended_mode_, false); | 164 ChangeMode(intended_mode_, true); |
165 return FALSE; | 165 return FALSE; |
166 } | 166 } |
167 | 167 |
168 gboolean ReloadButtonGtk::OnQueryTooltip(GtkWidget* sender, | 168 gboolean ReloadButtonGtk::OnQueryTooltip(GtkWidget* sender, |
169 gint x, | 169 gint x, |
170 gint y, | 170 gint y, |
171 gboolean keyboard_mode, | 171 gboolean keyboard_mode, |
172 GtkTooltip* tooltip) { | 172 GtkTooltip* tooltip) { |
173 // |location_bar_| can be NULL in tests. | 173 // |location_bar_| can be NULL in tests. |
174 if (!location_bar_) | 174 if (!location_bar_) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 reload_.Height()); | 207 reload_.Height()); |
208 | 208 |
209 gtk_widget_set_app_paintable(widget_.get(), TRUE); | 209 gtk_widget_set_app_paintable(widget_.get(), TRUE); |
210 // We effectively double-buffer by virtue of having only one image... | 210 // We effectively double-buffer by virtue of having only one image... |
211 gtk_widget_set_double_buffered(widget_.get(), FALSE); | 211 gtk_widget_set_double_buffered(widget_.get(), FALSE); |
212 } | 212 } |
213 | 213 |
214 gtk_chrome_button_set_use_gtk_rendering( | 214 gtk_chrome_button_set_use_gtk_rendering( |
215 GTK_CHROME_BUTTON(widget_.get()), use_gtk); | 215 GTK_CHROME_BUTTON(widget_.get()), use_gtk); |
216 } | 216 } |
OLD | NEW |