diff options
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r-- | chrome/common/gtk_util.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index 31f9b82..16ce02b 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -49,6 +49,15 @@ gboolean OnMouseButtonReleased(GtkWidget* widget, GdkEventButton* event, return TRUE; } +// Ownership of |icon_list| is passed to the caller. +GList* GetIconList() { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + GList* icon_list = NULL; + icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_ICON_32)); + icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_LOGO_16)); + return icon_list; +} + } // namespace namespace event_utils { @@ -310,14 +319,17 @@ bool WidgetContainsCursor(GtkWidget* widget) { } void SetWindowIcon(GtkWindow* window) { - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - GList* icon_list = NULL; - icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_ICON_32)); - icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_LOGO_16)); + GList* icon_list = GetIconList(); gtk_window_set_icon_list(window, icon_list); g_list_free(icon_list); } +void SetDefaultWindowIcon() { + GList* icon_list = GetIconList(); + gtk_window_set_default_icon_list(icon_list); + g_list_free(icon_list); +} + GtkWidget* AddButtonToDialog(GtkWidget* dialog, const gchar* text, const gchar* stock_id, gint response_id) { GtkWidget* button = gtk_button_new_with_label(text); |