summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 20:40:05 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 20:40:05 +0000
commit4411c21f13e7da66f3c9d394f40c1f10b6d20782 (patch)
tree3b9994e437f2e1312d209ce3dd940198baf9781c /chrome
parent69256505689d6e1aad04c2ac737972c4549d7113 (diff)
downloadchromium_src-4411c21f13e7da66f3c9d394f40c1f10b6d20782.zip
chromium_src-4411c21f13e7da66f3c9d394f40c1f10b6d20782.tar.gz
chromium_src-4411c21f13e7da66f3c9d394f40c1f10b6d20782.tar.bz2
Add stubs for the rest of the gtk advanced options sections. Hook up the reset prefs function.
BUG=11507 Review URL: http://codereview.chromium.org/149097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc126
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.h8
-rw-r--r--chrome/browser/gtk/options/advanced_page_gtk.cc3
3 files changed, 135 insertions, 2 deletions
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index a94826ee..5cda920 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -18,6 +18,58 @@
///////////////////////////////////////////////////////////////////////////////
+// DownloadSection
+
+class DownloadSection : public OptionsPageBase {
+ public:
+ explicit DownloadSection(Profile* profile);
+ virtual ~DownloadSection() {}
+
+ GtkWidget* get_page_widget() const {
+ return page_;
+ }
+
+ private:
+ // The widget containing the options for this section.
+ GtkWidget* page_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadSection);
+};
+
+DownloadSection::DownloadSection(Profile* profile)
+ : OptionsPageBase(profile) {
+ page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO download options"),
+ FALSE, FALSE, 0);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// NetworkSection
+
+class NetworkSection : public OptionsPageBase {
+ public:
+ explicit NetworkSection(Profile* profile);
+ virtual ~NetworkSection() {}
+
+ GtkWidget* get_page_widget() const {
+ return page_;
+ }
+
+ private:
+ // The widget containing the options for this section.
+ GtkWidget* page_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkSection);
+};
+
+NetworkSection::NetworkSection(Profile* profile)
+ : OptionsPageBase(profile) {
+ page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO network options"),
+ FALSE, FALSE, 0);
+}
+
+///////////////////////////////////////////////////////////////////////////////
// PrivacySection
class PrivacySection : public OptionsPageBase {
@@ -55,7 +107,7 @@ PrivacySection::PrivacySection(Profile* profile) : OptionsPageBase(profile) {
gtk_container_add(GTK_CONTAINER(metrics), metrics_label);
gtk_box_pack_start(GTK_BOX(page_), metrics, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(page_),
- gtk_label_new("TODO rest of the advanced options"),
+ gtk_label_new("TODO rest of the privacy options"),
FALSE, FALSE, 0);
bool logging = g_browser_process->local_state()->GetBoolean(
prefs::kMetricsReportingEnabled);
@@ -78,6 +130,58 @@ void PrivacySection::LoggingChanged(GtkWidget* metrics) {
}
///////////////////////////////////////////////////////////////////////////////
+// SecuritySection
+
+class SecuritySection : public OptionsPageBase {
+ public:
+ explicit SecuritySection(Profile* profile);
+ virtual ~SecuritySection() {}
+
+ GtkWidget* get_page_widget() const {
+ return page_;
+ }
+
+ private:
+ // The widget containing the options for this section.
+ GtkWidget* page_;
+
+ DISALLOW_COPY_AND_ASSIGN(SecuritySection);
+};
+
+SecuritySection::SecuritySection(Profile* profile)
+ : OptionsPageBase(profile) {
+ page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO security options"),
+ FALSE, FALSE, 0);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// WebContentSection
+
+class WebContentSection : public OptionsPageBase {
+ public:
+ explicit WebContentSection(Profile* profile);
+ virtual ~WebContentSection() {}
+
+ GtkWidget* get_page_widget() const {
+ return page_;
+ }
+
+ private:
+ // The widget containing the options for this section.
+ GtkWidget* page_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentSection);
+};
+
+WebContentSection::WebContentSection(Profile* profile)
+ : OptionsPageBase(profile) {
+ page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
+ gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO web content options"),
+ FALSE, FALSE, 0);
+}
+
+///////////////////////////////////////////////////////////////////////////////
// AdvancedContentsGtk
AdvancedContentsGtk::AdvancedContentsGtk(Profile* profile)
@@ -91,10 +195,30 @@ AdvancedContentsGtk::~AdvancedContentsGtk() {
void AdvancedContentsGtk::Init() {
OptionsLayoutBuilderGtk options_builder;
+ network_section_.reset(new NetworkSection(profile_));
+ options_builder.AddOptionGroup(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK),
+ network_section_->get_page_widget(), false);
+
privacy_section_.reset(new PrivacySection(profile_));
options_builder.AddOptionGroup(
l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY),
privacy_section_->get_page_widget(), false);
+ download_section_.reset(new DownloadSection(profile_));
+ options_builder.AddOptionGroup(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME),
+ download_section_->get_page_widget(), false);
+
+ web_content_section_.reset(new WebContentSection(profile_));
+ options_builder.AddOptionGroup(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT),
+ web_content_section_->get_page_widget(), false);
+
+ security_section_.reset(new SecuritySection(profile_));
+ options_builder.AddOptionGroup(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY),
+ security_section_->get_page_widget(), false);
+
page_ = options_builder.get_page_widget();
}
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.h b/chrome/browser/gtk/options/advanced_contents_gtk.h
index 79c9427..befd3c5 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.h
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.h
@@ -11,7 +11,11 @@
#include "base/scoped_ptr.h"
class Profile;
+class DownloadSection;
+class NetworkSection;
class PrivacySection;
+class SecuritySection;
+class WebContentSection;
class AdvancedContentsGtk {
public:
@@ -29,7 +33,11 @@ class AdvancedContentsGtk {
Profile* profile_;
// The sections of the page.
+ scoped_ptr<DownloadSection> download_section_;
+ scoped_ptr<NetworkSection> network_section_;
scoped_ptr<PrivacySection> privacy_section_;
+ scoped_ptr<SecuritySection> security_section_;
+ scoped_ptr<WebContentSection> web_content_section_;
// The widget containing the advanced options sections.
GtkWidget* page_;
diff --git a/chrome/browser/gtk/options/advanced_page_gtk.cc b/chrome/browser/gtk/options/advanced_page_gtk.cc
index 154d5b4..65a93ad 100644
--- a/chrome/browser/gtk/options/advanced_page_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_page_gtk.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/gtk/options/advanced_page_gtk.h"
#include "app/l10n_util.h"
+#include "chrome/browser/options_util.h"
#include "chrome/common/gtk_util.h"
#include "grit/generated_resources.h"
#include "grit/chromium_strings.h"
@@ -73,7 +74,7 @@ void AdvancedPageGtk::OnResetToDefaultsClicked(
void AdvancedPageGtk::OnResetToDefaultsResponse(
GtkDialog* dialog, int response_id, AdvancedPageGtk* advanced_page) {
if (response_id == GTK_RESPONSE_OK) {
- NOTIMPLEMENTED();
+ OptionsUtil::ResetToDefaults(advanced_page->profile());
}
gtk_widget_destroy(GTK_WIDGET(dialog));
}