OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extension_installed_bubble_gtk.h" | 5 #include "chrome/browser/gtk/extension_installed_bubble_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 g_object_unref(old); | 143 g_object_unref(old); |
144 } | 144 } |
145 | 145 |
146 // Put Icon in top of the left column. | 146 // Put Icon in top of the left column. |
147 GtkWidget* icon_column = gtk_vbox_new(FALSE, 0); | 147 GtkWidget* icon_column = gtk_vbox_new(FALSE, 0); |
148 // Use 3 pixel padding to get visual balance with InfoBubble border on the | 148 // Use 3 pixel padding to get visual balance with InfoBubble border on the |
149 // left. | 149 // left. |
150 gtk_box_pack_start(GTK_BOX(bubble_content), icon_column, FALSE, FALSE, | 150 gtk_box_pack_start(GTK_BOX(bubble_content), icon_column, FALSE, FALSE, |
151 kIconPadding); | 151 kIconPadding); |
152 GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); | 152 GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); |
| 153 g_object_unref(pixbuf); |
153 gtk_box_pack_start(GTK_BOX(icon_column), image, FALSE, FALSE, 0); | 154 gtk_box_pack_start(GTK_BOX(icon_column), image, FALSE, FALSE, 0); |
154 | 155 |
155 // Center text column. | 156 // Center text column. |
156 GtkWidget* text_column = gtk_vbox_new(FALSE, kTextColumnVerticalSpacing); | 157 GtkWidget* text_column = gtk_vbox_new(FALSE, kTextColumnVerticalSpacing); |
157 gtk_box_pack_start(GTK_BOX(bubble_content), text_column, FALSE, FALSE, 0); | 158 gtk_box_pack_start(GTK_BOX(bubble_content), text_column, FALSE, FALSE, 0); |
158 | 159 |
159 // Heading label | 160 // Heading label |
160 GtkWidget* heading_label = gtk_label_new(NULL); | 161 GtkWidget* heading_label = gtk_label_new(NULL); |
161 std::string heading_text = WideToUTF8(l10n_util::GetStringF( | 162 std::string heading_text = WideToUTF8(l10n_util::GetStringF( |
162 IDS_EXTENSION_INSTALLED_HEADING, | 163 IDS_EXTENSION_INSTALLED_HEADING, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // the window before we call Release() because close_button_ depends | 243 // the window before we call Release() because close_button_ depends |
243 // on all references being cleared before it is destroyed. | 244 // on all references being cleared before it is destroyed. |
244 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 245 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
245 &ExtensionInstalledBubbleGtk::Close)); | 246 &ExtensionInstalledBubbleGtk::Close)); |
246 } | 247 } |
247 | 248 |
248 void ExtensionInstalledBubbleGtk::Close() { | 249 void ExtensionInstalledBubbleGtk::Close() { |
249 Release(); // Balanced in ctor. | 250 Release(); // Balanced in ctor. |
250 info_bubble_ = NULL; | 251 info_bubble_ = NULL; |
251 } | 252 } |
OLD | NEW |