| OLD | NEW |
| 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/avatar_menu_item_gtk.h" | 5 #include "chrome/browser/ui/gtk/avatar_menu_item_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 base::Bind(&AvatarMenuItemGtk::EditProfile, | 198 base::Bind(&AvatarMenuItemGtk::EditProfile, |
| 199 weak_factory_.GetWeakPtr())); | 199 weak_factory_.GetWeakPtr())); |
| 200 } | 200 } |
| 201 | 201 |
| 202 gboolean AvatarMenuItemGtk::OnEventBoxExpose(GtkWidget* widget, | 202 gboolean AvatarMenuItemGtk::OnEventBoxExpose(GtkWidget* widget, |
| 203 GdkEventExpose* event) { | 203 GdkEventExpose* event) { |
| 204 // Draw the focus rectangle. | 204 // Draw the focus rectangle. |
| 205 if (gtk_widget_has_focus(widget)) { | 205 if (gtk_widget_has_focus(widget)) { |
| 206 GtkAllocation allocation; | 206 GtkAllocation allocation; |
| 207 gtk_widget_get_allocation(widget, &allocation); | 207 gtk_widget_get_allocation(widget, &allocation); |
| 208 gtk_paint_focus(widget->style, widget->window, | 208 gtk_paint_focus(gtk_widget_get_style(widget), |
| 209 gtk_widget_get_window(widget), |
| 209 gtk_widget_get_state(widget), | 210 gtk_widget_get_state(widget), |
| 210 &event->area, widget, NULL, | 211 &event->area, widget, NULL, |
| 211 0, 0, | 212 0, 0, |
| 212 allocation.width, allocation.height); | 213 allocation.width, allocation.height); |
| 213 } | 214 } |
| 214 | 215 |
| 215 return TRUE; | 216 return TRUE; |
| 216 } | 217 } |
| 217 | 218 |
| 218 void AvatarMenuItemGtk::Init(GtkThemeService* theme_service) { | 219 void AvatarMenuItemGtk::Init(GtkThemeService* theme_service) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 313 |
| 313 GtkSizeGroup* size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | 314 GtkSizeGroup* size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
| 314 gtk_size_group_add_widget(size_group, status_label_); | 315 gtk_size_group_add_widget(size_group, status_label_); |
| 315 gtk_size_group_add_widget(size_group, link_alignment_); | 316 gtk_size_group_add_widget(size_group, link_alignment_); |
| 316 g_object_unref(size_group); | 317 g_object_unref(size_group); |
| 317 } | 318 } |
| 318 | 319 |
| 319 gtk_box_pack_start(GTK_BOX(item_hbox), item_vbox, TRUE, TRUE, 0); | 320 gtk_box_pack_start(GTK_BOX(item_hbox), item_vbox, TRUE, TRUE, 0); |
| 320 gtk_container_add(GTK_CONTAINER(widget_.get()), item_hbox); | 321 gtk_container_add(GTK_CONTAINER(widget_.get()), item_hbox); |
| 321 } | 322 } |
| OLD | NEW |