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

Side by Side Diff: chrome/browser/gtk/extension_installed_bubble_gtk.cc

Issue 1075014: Linux: Fix some GdkPixbuf leaks. (Closed)
Patch Set: move BrowserThemeProvider comment to the public functions Created 10 years, 9 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/extension_install_prompt_gtk.cc ('k') | chrome/browser/gtk/hung_renderer_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698