summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 00:14:13 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 00:14:13 +0000
commite3a3f854c2d09b87cf1373eeaaf26cdb6decb08b (patch)
tree5e664f504ac7c62a4baa1f792e647338db801a45 /chrome/browser/gtk
parent4c7bd79185d3b8375f401c4e158107f661ccfdfd (diff)
downloadchromium_src-e3a3f854c2d09b87cf1373eeaaf26cdb6decb08b.zip
chromium_src-e3a3f854c2d09b87cf1373eeaaf26cdb6decb08b.tar.gz
chromium_src-e3a3f854c2d09b87cf1373eeaaf26cdb6decb08b.tar.bz2
Add "learn more" link to privacy settings.
BUG=11507 Review URL: http://codereview.chromium.org/149581 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20584 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index ade476b..84de4b0 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -6,7 +6,9 @@
#include "app/l10n_util.h"
#include "base/basictypes.h"
+#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/gtk/gtk_chrome_link_button.h"
#include "chrome/browser/gtk/options/options_layout_gtk.h"
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/options_page_base.h"
@@ -18,6 +20,7 @@
#include "chrome/installer/util/google_update_settings.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
#include "net/base/cookie_policy.h"
namespace {
@@ -113,6 +116,8 @@ class PrivacySection : public OptionsPageBase {
virtual void NotifyPrefChanged(const std::wstring* pref_name);
// The callback functions for the options widgets.
+ static void OnLearnMoreLinkClicked(GtkButton *button,
+ PrivacySection* privacy_section);
static void OnEnableLinkDoctorChange(GtkWidget* widget,
PrivacySection* options_window);
static void OnEnableSuggestChange(GtkWidget* widget,
@@ -163,7 +168,16 @@ PrivacySection::PrivacySection(Profile* profile)
gtk_box_pack_start(GTK_BOX(page_), section_description_label,
FALSE, FALSE, 0);
- // TODO(mattm): Learn more link
+ GtkWidget* learn_more_link = gtk_chrome_link_button_new(
+ l10n_util::GetStringUTF8(IDS_LEARN_MORE).c_str());
+ // Stick it in an hbox so it doesn't expand to the whole width.
+ GtkWidget* learn_more_hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(learn_more_hbox), learn_more_link,
+ FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(page_), learn_more_hbox,
+ FALSE, FALSE, 0);
+ g_signal_connect(learn_more_link, "clicked",
+ G_CALLBACK(OnLearnMoreLinkClicked), this);
enable_link_doctor_checkbox_ = CreateCheckButtonWithWrappedLabel(
IDS_OPTIONS_LINKDOCTOR_PREF);
@@ -241,6 +255,14 @@ PrivacySection::PrivacySection(Profile* profile)
}
// static
+void PrivacySection::OnLearnMoreLinkClicked(GtkButton *button,
+ PrivacySection* privacy_section) {
+ BrowserList::GetLastActive()->
+ OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LEARN_MORE_PRIVACY_URL)),
+ GURL(), NEW_WINDOW, PageTransition::LINK);
+}
+
+// static
void PrivacySection::OnEnableLinkDoctorChange(GtkWidget* widget,
PrivacySection* privacy_section) {
if (privacy_section->initializing_)