summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/options/advanced_contents_gtk.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 19:39:21 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 19:39:21 +0000
commit41cf8020fe10d9949772f58af8504d768edd33a4 (patch)
treea9a291307dfe802c0aeddf7c5434102778d27427 /chrome/browser/gtk/options/advanced_contents_gtk.cc
parentc535a312073f7fc4eaed7e5efa3d0ef3df2e1dce (diff)
downloadchromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.zip
chromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.tar.gz
chromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.tar.bz2
Gtk cookie manager part 1.
(Doesn't display cookie details, otherwise working.) BUG=11507 TEST=All cookie manager functions should work as expected, other than viewing the cookie details. Review URL: http://codereview.chromium.org/159187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/options/advanced_contents_gtk.cc')
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc39
1 files changed, 30 insertions, 9 deletions
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index 5cf7141..7aa21b28 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/fonts_languages_window.h"
#include "chrome/browser/gtk/gtk_chrome_link_button.h"
+#include "chrome/browser/gtk/options/cookies_view.h"
#include "chrome/browser/gtk/options/options_layout_gtk.h"
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/options_page_base.h"
@@ -360,6 +361,8 @@ class PrivacySection : public OptionsPageBase {
PrivacySection* options_window);
static void OnCookieBehaviorChanged(GtkComboBox* combo_box,
PrivacySection* privacy_section);
+ static void OnShowCookiesButtonClicked(GtkButton *button,
+ PrivacySection* privacy_section);
// The widget containing the options for this section.
GtkWidget* page_;
@@ -448,6 +451,16 @@ PrivacySection::PrivacySection(Profile* profile)
G_CALLBACK(OnLoggingChange), this);
#endif
+ GtkWidget* cookie_description_label = gtk_label_new(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_COOKIES_ACCEPT_LABEL).c_str());
+ gtk_misc_set_alignment(GTK_MISC(cookie_description_label), 0, 0);
+ gtk_box_pack_start(GTK_BOX(page_), cookie_description_label, FALSE, FALSE, 0);
+
+ GtkWidget* cookie_controls = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(page_),
+ OptionsLayoutBuilderGtk::IndentWidget(cookie_controls),
+ FALSE, FALSE, 0);
+
cookie_behavior_combobox_ = gtk_combo_box_new_text();
gtk_combo_box_append_text(
GTK_COMBO_BOX(cookie_behavior_combobox_),
@@ -461,17 +474,18 @@ PrivacySection::PrivacySection(Profile* profile)
l10n_util::GetStringUTF8(IDS_OPTIONS_COOKIES_BLOCK_ALL_COOKIES).c_str());
g_signal_connect(G_OBJECT(cookie_behavior_combobox_), "changed",
G_CALLBACK(OnCookieBehaviorChanged), this);
+ gtk_box_pack_start(GTK_BOX(cookie_controls), cookie_behavior_combobox_,
+ FALSE, FALSE, 0);
- GtkWidget* cookie_controls = gtk_util::CreateLabeledControlsGroup(NULL,
- l10n_util::GetStringUTF8(IDS_OPTIONS_COOKIES_ACCEPT_LABEL).c_str(),
- cookie_behavior_combobox_,
- NULL);
- gtk_box_pack_start(GTK_BOX(page_), cookie_controls, FALSE, FALSE, 0);
-
- // TODO(mattm): show cookies button
- gtk_box_pack_start(GTK_BOX(page_),
- gtk_label_new("TODO rest of the privacy options"),
+ GtkWidget* show_cookies_button = gtk_button_new_with_label(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_COOKIES_SHOWCOOKIES).c_str());
+ g_signal_connect(show_cookies_button, "clicked",
+ G_CALLBACK(OnShowCookiesButtonClicked), this);
+ // Stick it in an hbox so it doesn't expand to the whole width.
+ GtkWidget* button_hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(button_hbox), show_cookies_button,
FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(cookie_controls), button_hbox, FALSE, FALSE, 0);
// Init member prefs so we can update the controls if prefs change.
alternate_error_pages_.Init(prefs::kAlternateErrorPagesEnabled,
@@ -604,6 +618,13 @@ void PrivacySection::OnCookieBehaviorChanged(GtkComboBox* combo_box,
privacy_section->cookie_behavior_.SetValue(cookie_policy);
}
+// static
+void PrivacySection::OnShowCookiesButtonClicked(
+ GtkButton *button, PrivacySection* privacy_section) {
+ privacy_section->UserMetricsRecordAction(L"Options_ShowCookies", NULL);
+ CookiesView::Show(privacy_section->profile());
+}
+
void PrivacySection::NotifyPrefChanged(const std::wstring* pref_name) {
initializing_ = true;
if (!pref_name || *pref_name == prefs::kAlternateErrorPagesEnabled) {