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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Create a two column layout. | 70 // Create a two column layout. |
71 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; | 71 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; |
72 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 72 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
73 | 73 |
74 GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); | 74 GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); |
75 gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); | 75 gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); |
76 | 76 |
77 // Put Icon in the left column. | 77 // Put Icon in the left column. |
78 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(skia_icon); | 78 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(skia_icon); |
79 GtkWidget* icon = gtk_image_new_from_pixbuf(pixbuf); | 79 GtkWidget* icon = gtk_image_new_from_pixbuf(pixbuf); |
| 80 g_object_unref(pixbuf); |
80 gtk_box_pack_start(GTK_BOX(icon_hbox), icon, TRUE, TRUE, 0); | 81 gtk_box_pack_start(GTK_BOX(icon_hbox), icon, TRUE, TRUE, 0); |
81 | 82 |
82 // Create a new vbox for the right column. | 83 // Create a new vbox for the right column. |
83 GtkWidget* right_column_area = gtk_vbox_new(FALSE, 0); | 84 GtkWidget* right_column_area = gtk_vbox_new(FALSE, 0); |
84 gtk_box_pack_start(GTK_BOX(icon_hbox), right_column_area, TRUE, TRUE, 0); | 85 gtk_box_pack_start(GTK_BOX(icon_hbox), right_column_area, TRUE, TRUE, 0); |
85 | 86 |
86 int heading_id = ExtensionInstallUI::kHeadingIds[type]; | 87 int heading_id = ExtensionInstallUI::kHeadingIds[type]; |
87 std::string heading_text = WideToUTF8(l10n_util::GetStringF( | 88 std::string heading_text = WideToUTF8(l10n_util::GetStringF( |
88 heading_id, UTF8ToWide(extension->name()))); | 89 heading_id, UTF8ToWide(extension->name()))); |
89 GtkWidget* heading_label = MakeMarkupLabel("<span weight=\"bold\">%s</span>", | 90 GtkWidget* heading_label = MakeMarkupLabel("<span weight=\"bold\">%s</span>", |
(...skipping 28 matching lines...) Expand all Loading... |
118 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( | 119 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
119 browser->window()); | 120 browser->window()); |
120 if (!browser_window) { | 121 if (!browser_window) { |
121 delegate->InstallUIAbort(); | 122 delegate->InstallUIAbort(); |
122 return; | 123 return; |
123 } | 124 } |
124 | 125 |
125 ShowInstallPromptDialog(browser_window->window(), icon, extension, | 126 ShowInstallPromptDialog(browser_window->window(), icon, extension, |
126 delegate, warning_text, type); | 127 delegate, warning_text, type); |
127 } | 128 } |
OLD | NEW |