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_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/avatar_menu_model.h" | 9 #include "chrome/browser/profiles/avatar_menu_model.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 theme_service_->InitThemesFor(this); | 65 theme_service_->InitThemesFor(this); |
66 } | 66 } |
67 | 67 |
68 AvatarMenuBubbleGtk::~AvatarMenuBubbleGtk() { | 68 AvatarMenuBubbleGtk::~AvatarMenuBubbleGtk() { |
69 STLDeleteContainerPointers(items_.begin(), items_.end()); | 69 STLDeleteContainerPointers(items_.begin(), items_.end()); |
70 } | 70 } |
71 | 71 |
72 void AvatarMenuBubbleGtk::OnDestroy(GtkWidget* widget) { | 72 void AvatarMenuBubbleGtk::OnDestroy(GtkWidget* widget) { |
73 // We are self deleting, we have a destroy signal setup to catch when we | 73 // We are self deleting, we have a destroy signal setup to catch when we |
74 // destroyed (via the BubbleGtk being destroyed), and delete ourself. | 74 // destroyed (via the BubbleGtk being destroyed), and delete ourself. |
75 delete this; | 75 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
76 } | 76 } |
77 | 77 |
78 void AvatarMenuBubbleGtk::BubbleClosing(BubbleGtk* bubble, | 78 void AvatarMenuBubbleGtk::BubbleClosing(BubbleGtk* bubble, |
79 bool closed_by_escape) { | 79 bool closed_by_escape) { |
80 } | 80 } |
81 | 81 |
82 void AvatarMenuBubbleGtk::OnAvatarMenuModelChanged( | 82 void AvatarMenuBubbleGtk::OnAvatarMenuModelChanged( |
83 AvatarMenuModel* avatar_menu_model) { | 83 AvatarMenuModel* avatar_menu_model) { |
84 STLDeleteContainerPointers(items_.begin(), items_.end()); | 84 STLDeleteContainerPointers(items_.begin(), items_.end()); |
85 items_.clear(); | 85 items_.clear(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 g_signal_connect(new_profile_link_, "clicked", | 154 g_signal_connect(new_profile_link_, "clicked", |
155 G_CALLBACK(OnNewProfileLinkClickedThunk), this); | 155 G_CALLBACK(OnNewProfileLinkClickedThunk), this); |
156 | 156 |
157 GtkWidget* link_align = gtk_alignment_new(0, 0, 0, 0); | 157 GtkWidget* link_align = gtk_alignment_new(0, 0, 0, 0); |
158 gtk_alignment_set_padding(GTK_ALIGNMENT(link_align), | 158 gtk_alignment_set_padding(GTK_ALIGNMENT(link_align), |
159 0, 0, kNewProfileLinkLeftPadding, 0); | 159 0, 0, kNewProfileLinkLeftPadding, 0); |
160 gtk_container_add(GTK_CONTAINER(link_align), new_profile_link_); | 160 gtk_container_add(GTK_CONTAINER(link_align), new_profile_link_); |
161 | 161 |
162 gtk_box_pack_start(GTK_BOX(contents_), link_align, FALSE, FALSE, 0); | 162 gtk_box_pack_start(GTK_BOX(contents_), link_align, FALSE, FALSE, 0); |
163 } | 163 } |
OLD | NEW |