diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 03:01:51 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 03:01:51 +0000 |
commit | 28402908e9e331ccb139a9eb709ddd8f838b9440 (patch) | |
tree | 9ce4b129f48ac01589b9d1ffd10c35a2f21c2b5a | |
parent | 11c9f1e5edf0674382f45ad830fed191895c3a9d (diff) | |
download | chromium_src-28402908e9e331ccb139a9eb709ddd8f838b9440.zip chromium_src-28402908e9e331ccb139a9eb709ddd8f838b9440.tar.gz chromium_src-28402908e9e331ccb139a9eb709ddd8f838b9440.tar.bz2 |
Set window icon on options dialog, bookmark manager.
BUG=16951
TEST=launch bookmark manager on gnome/metacity, observe that window has icon
Review URL: http://codereview.chromium.org/155672
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20928 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.cc | 1 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/options/options_window_gtk.cc | 1 | ||||
-rw-r--r-- | chrome/common/gtk_util.cc | 11 | ||||
-rw-r--r-- | chrome/common/gtk_util.h | 4 |
5 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index eea1bbc..9ccad4d 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -302,6 +302,7 @@ BookmarkManagerGtk::BookmarkManagerGtk(Profile* profile) delaying_mousedown_(false), sending_delayed_mousedown_(false) { InitWidgets(); + gtk_util::SetWindowIcon(GTK_WINDOW(window_)); g_signal_connect(window_, "destroy", G_CALLBACK(OnWindowDestroy), this); diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index b15c9fc..a5239c3 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -183,9 +183,6 @@ class BrowserWindowGtk : public BrowserWindow, // resize it. void SetGeometryHints(); - // Set up the window icon (potentially used in window border or alt-tab list). - void SetWindowIcon(); - // Connect to signals on |window_|. void ConnectHandlersToSignals(); diff --git a/chrome/browser/gtk/options/options_window_gtk.cc b/chrome/browser/gtk/options/options_window_gtk.cc index 349615d..d155d38 100644 --- a/chrome/browser/gtk/options/options_window_gtk.cc +++ b/chrome/browser/gtk/options/options_window_gtk.cc @@ -99,6 +99,7 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), gtk_util::kContentAreaSpacing); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); notebook_ = gtk_notebook_new(); diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index 68a1fd0..dfb0ac8 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -10,8 +10,10 @@ #include <cstdarg> #include "app/l10n_util.h" +#include "app/resource_bundle.h" #include "base/linux_util.h" #include "base/logging.h" +#include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" namespace { @@ -395,4 +397,13 @@ bool WidgetContainsCursor(GtkWidget* widget) { return widget_allocation.Contains(x, y); } +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)); + gtk_window_set_icon_list(window, icon_list); + g_list_free(icon_list); +} + } // namespace gtk_util diff --git a/chrome/common/gtk_util.h b/chrome/common/gtk_util.h index 9a71570..4a17c21 100644 --- a/chrome/common/gtk_util.h +++ b/chrome/common/gtk_util.h @@ -124,6 +124,10 @@ int MirroredXCoordinate(GtkWidget* widget, int x); // Returns true if the pointer is currently inside the widget. bool WidgetContainsCursor(GtkWidget* widget); +// Sets the icon of |window| to the product icon (potentially used in window +// border or alt-tab list). +void SetWindowIcon(GtkWindow* window); + } // namespace gtk_util #endif // CHROME_COMMON_GTK_UTIL_H_ |