summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 00:58:46 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 00:58:46 +0000
commitd0646f3c8b551ca04f614e587e3f8f2e3d39f727 (patch)
treeb0b89372df961083b4112d80bc89f90496b7aac5 /chrome/common/gtk_util.cc
parent621f9ac0774b4656a2a34a11075e97ef9c3786a2 (diff)
downloadchromium_src-d0646f3c8b551ca04f614e587e3f8f2e3d39f727.zip
chromium_src-d0646f3c8b551ca04f614e587e3f8f2e3d39f727.tar.gz
chromium_src-d0646f3c8b551ca04f614e587e3f8f2e3d39f727.tar.bz2
GTK: Set the default icon list so we don't have to set it on every window all the time.
Review URL: http://codereview.chromium.org/174586 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r--chrome/common/gtk_util.cc20
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);