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

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

Issue 9109028: GTK: Another GTK deprecation patch. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: evanm fix Created 8 years, 11 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
« no previous file with comments | « chrome/browser/ui/gtk/menu_gtk.cc ('k') | chrome/browser/ui/gtk/rounded_window.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/reload_button_gtk.h" 5 #include "chrome/browser/ui/gtk/reload_button_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 (visible_mode_ == MODE_RELOAD) ? 223 (visible_mode_ == MODE_RELOAD) ?
224 IDS_TOOLTIP_RELOAD : IDS_TOOLTIP_STOP).c_str()); 224 IDS_TOOLTIP_RELOAD : IDS_TOOLTIP_STOP).c_str());
225 return TRUE; 225 return TRUE;
226 } 226 }
227 227
228 void ReloadButtonGtk::UpdateThemeButtons() { 228 void ReloadButtonGtk::UpdateThemeButtons() {
229 bool use_gtk = theme_service_ && theme_service_->UsingNativeTheme(); 229 bool use_gtk = theme_service_ && theme_service_->UsingNativeTheme();
230 230
231 if (use_gtk) { 231 if (use_gtk) {
232 gtk_widget_ensure_style(widget()); 232 gtk_widget_ensure_style(widget());
233 GtkStyle* style = gtk_widget_get_style(widget());
233 GtkIconSet* icon_set = gtk_style_lookup_icon_set( 234 GtkIconSet* icon_set = gtk_style_lookup_icon_set(
234 widget()->style, 235 style,
235 (visible_mode_ == MODE_RELOAD) ? GTK_STOCK_REFRESH : GTK_STOCK_STOP); 236 (visible_mode_ == MODE_RELOAD) ? GTK_STOCK_REFRESH : GTK_STOCK_STOP);
236 if (icon_set) { 237 if (icon_set) {
237 GtkStateType state = gtk_widget_get_state(widget()); 238 GtkStateType state = gtk_widget_get_state(widget());
238 if (visible_mode_ == MODE_STOP && stop_.paint_override() != -1) 239 if (visible_mode_ == MODE_STOP && stop_.paint_override() != -1)
239 state = static_cast<GtkStateType>(stop_.paint_override()); 240 state = static_cast<GtkStateType>(stop_.paint_override());
240 241
241 GdkPixbuf* pixbuf = gtk_icon_set_render_icon( 242 GdkPixbuf* pixbuf = gtk_icon_set_render_icon(
242 icon_set, 243 icon_set,
243 widget()->style, 244 style,
244 gtk_widget_get_direction(widget()), 245 gtk_widget_get_direction(widget()),
245 state, 246 state,
246 GTK_ICON_SIZE_SMALL_TOOLBAR, 247 GTK_ICON_SIZE_SMALL_TOOLBAR,
247 widget(), 248 widget(),
248 NULL); 249 NULL);
249 250
250 gtk_button_set_image(GTK_BUTTON(widget()), 251 gtk_button_set_image(GTK_BUTTON(widget()),
251 gtk_image_new_from_pixbuf(pixbuf)); 252 gtk_image_new_from_pixbuf(pixbuf));
252 g_object_unref(pixbuf); 253 g_object_unref(pixbuf);
253 } 254 }
(...skipping 19 matching lines...) Expand all
273 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk); 274 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk);
274 } 275 }
275 276
276 void ReloadButtonGtk::OnDoubleClickTimer() { 277 void ReloadButtonGtk::OnDoubleClickTimer() {
277 ChangeMode(intended_mode_, false); 278 ChangeMode(intended_mode_, false);
278 } 279 }
279 280
280 void ReloadButtonGtk::OnStopToReloadTimer() { 281 void ReloadButtonGtk::OnStopToReloadTimer() {
281 ChangeMode(intended_mode_, true); 282 ChangeMode(intended_mode_, true);
282 } 283 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/menu_gtk.cc ('k') | chrome/browser/ui/gtk/rounded_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698