summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 22:57:22 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 22:57:22 +0000
commiteefb1d18b254aa26c65bff7135071fb69804e1a4 (patch)
tree268b477a25a8af1ea65d88cbb8a7fb8f9028b732 /chrome
parent628476aa50961d49567577e6442051d2d7d6663b (diff)
downloadchromium_src-eefb1d18b254aa26c65bff7135071fb69804e1a4.zip
chromium_src-eefb1d18b254aa26c65bff7135071fb69804e1a4.tar.gz
chromium_src-eefb1d18b254aa26c65bff7135071fb69804e1a4.tar.bz2
Gtk: Side tabs for content settings window.
UI leads-approved. BUG=45546 TEST=Open content settings window. Tabs are now on the left. Review URL: http://codereview.chromium.org/2717007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/options/content_settings_window_gtk.cc51
1 files changed, 21 insertions, 30 deletions
diff --git a/chrome/browser/gtk/options/content_settings_window_gtk.cc b/chrome/browser/gtk/options/content_settings_window_gtk.cc
index a9421d4..3b5bc2d 100644
--- a/chrome/browser/gtk/options/content_settings_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_settings_window_gtk.cc
@@ -90,36 +90,27 @@ ContentSettingsWindowGtk::ContentSettingsWindowGtk(GtkWindow* parent,
notebook_ = gtk_notebook_new();
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- cookie_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_COOKIES_TAB_LABEL).c_str()));
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- image_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_IMAGES_TAB_LABEL).c_str()));
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- javascript_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_JAVASCRIPT_TAB_LABEL).c_str()));
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- plugin_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_PLUGIN_TAB_LABEL).c_str()));
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- popup_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_POPUP_TAB_LABEL).c_str()));
- gtk_notebook_append_page(
- GTK_NOTEBOOK(notebook_),
- geolocation_page_.get_page_widget(),
- gtk_label_new(
- l10n_util::GetStringUTF8(IDS_GEOLOCATION_TAB_LABEL).c_str()));
+ const struct {
+ int message_id;
+ GtkWidget* widget;
+ } kNotebookPages[] = {
+ { IDS_COOKIES_TAB_LABEL, cookie_page_.get_page_widget() },
+ { IDS_IMAGES_TAB_LABEL, image_page_.get_page_widget() },
+ { IDS_JAVASCRIPT_TAB_LABEL, javascript_page_.get_page_widget() },
+ { IDS_PLUGIN_TAB_LABEL, plugin_page_.get_page_widget() },
+ { IDS_POPUP_TAB_LABEL, popup_page_.get_page_widget() },
+ { IDS_GEOLOCATION_TAB_LABEL, geolocation_page_.get_page_widget() },
+ };
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNotebookPages); ++i) {
+ std::string label = l10n_util::GetStringUTF8(kNotebookPages[i].message_id);
+ // Since the tabs are on the side, add some padding space to the label.
+ gtk_notebook_append_page(
+ GTK_NOTEBOOK(notebook_),
+ kNotebookPages[i].widget,
+ gtk_label_new((" " + label + " ").c_str()));
+ }
+
+ gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook_), GTK_POS_LEFT);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_);