summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 18:59:13 +0000
committermdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 18:59:13 +0000
commitb0c75f5718ab737cbdb16c3c17b0ffc185a4c7c6 (patch)
tree28bf6277174dd24f98d4236af76b39000955b89e /chrome
parent13b05bee8fbd996d15f0b86302976e7ede29740a (diff)
downloadchromium_src-b0c75f5718ab737cbdb16c3c17b0ffc185a4c7c6.zip
chromium_src-b0c75f5718ab737cbdb16c3c17b0ffc185a4c7c6.tar.gz
chromium_src-b0c75f5718ab737cbdb16c3c17b0ffc185a4c7c6.tar.bz2
Linux: expose "Use system title bar and borders" preference in options dialog.
BUG=19483 TEST=none Review URL: http://codereview.chromium.org/193033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/options/content_page_gtk.cc30
-rw-r--r--chrome/browser/gtk/options/content_page_gtk.h10
2 files changed, 38 insertions, 2 deletions
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc
index b0b619c..95a6476 100644
--- a/chrome/browser/gtk/options/content_page_gtk.cc
+++ b/chrome/browser/gtk/options/content_page_gtk.cc
@@ -49,6 +49,8 @@ ContentPageGtk::ContentPageGtk(Profile* profile)
profile->GetPrefs(), this);
ask_to_save_form_autofill_.Init(prefs::kFormAutofillEnabled,
profile->GetPrefs(), this);
+ use_custom_chrome_frame_.Init(prefs::kUseCustomChromeFrame,
+ profile->GetPrefs(), this);
// Load initial values
NotifyPrefChanged(NULL);
@@ -57,6 +59,9 @@ ContentPageGtk::ContentPageGtk(Profile* profile)
ContentPageGtk::~ContentPageGtk() {
}
+// If |pref_name| is NULL, set the state of all the widgets. (This is used
+// in ContentPageGtk() above to initialize the dialog.) Otherwise, reset the
+// state of the widget for the given preference name, as it has changed.
void ContentPageGtk::NotifyPrefChanged(const std::wstring* pref_name) {
initializing_ = true;
if (!pref_name || *pref_name == prefs::kPasswordManagerEnabled) {
@@ -77,6 +82,11 @@ void ContentPageGtk::NotifyPrefChanged(const std::wstring* pref_name) {
GTK_TOGGLE_BUTTON(form_autofill_neversave_radio_), TRUE);
}
}
+ if (!pref_name || *pref_name == prefs::kUseCustomChromeFrame) {
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(system_title_bar_checkbox_),
+ !use_custom_chrome_frame_.GetValue());
+ }
initializing_ = false;
}
@@ -172,8 +182,17 @@ GtkWidget* ContentPageGtk::InitBrowsingDataGroup() {
}
GtkWidget* ContentPageGtk::InitThemesGroup() {
+ GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing);
+ // "Use system title bar and borders" checkbox.
+ system_title_bar_checkbox_ = gtk_check_button_new_with_label(
+ l10n_util::GetStringUTF8(IDS_SHOW_WINDOW_DECORATIONS).c_str());
+ g_signal_connect(G_OBJECT(system_title_bar_checkbox_), "clicked",
+ G_CALLBACK(OnSystemTitleBarCheckboxClicked), this);
+ gtk_box_pack_start(GTK_BOX(vbox), system_title_bar_checkbox_,
+ FALSE, FALSE, 0);
+
// GTK theme button.
GtkWidget* gtk_theme_button = gtk_button_new_with_label(
l10n_util::GetStringUTF8(IDS_THEMES_GTK_BUTTON).c_str());
@@ -195,7 +214,9 @@ GtkWidget* ContentPageGtk::InitThemesGroup() {
G_CALLBACK(OnGetThemesButtonClicked), this);
gtk_box_pack_start(GTK_BOX(hbox), themes_gallery_button, FALSE, FALSE, 0);
- return hbox;
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ return vbox;
}
// static
@@ -241,6 +262,13 @@ void ContentPageGtk::OnGetThemesButtonClicked(GtkButton* widget,
}
// static
+void ContentPageGtk::OnSystemTitleBarCheckboxClicked(GtkButton* widget,
+ ContentPageGtk* page) {
+ bool use_custom = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ page->use_custom_chrome_frame_.SetValue(use_custom);
+}
+
+// static
void ContentPageGtk::OnPasswordsExceptionsButtonClicked(GtkButton* widget,
ContentPageGtk* page) {
ShowPasswordsExceptionsWindow(page->profile());
diff --git a/chrome/browser/gtk/options/content_page_gtk.h b/chrome/browser/gtk/options/content_page_gtk.h
index cef12ac..4bc27a8 100644
--- a/chrome/browser/gtk/options/content_page_gtk.h
+++ b/chrome/browser/gtk/options/content_page_gtk.h
@@ -49,6 +49,10 @@ class ContentPageGtk : public OptionsPageBase {
static void OnGetThemesButtonClicked(GtkButton* widget,
ContentPageGtk* page);
+ // Callback for system title bar checkbox.
+ static void OnSystemTitleBarCheckboxClicked(GtkButton* widget,
+ ContentPageGtk* page);
+
// Callback for passwords exceptions button.
static void OnPasswordsExceptionsButtonClicked(GtkButton* widget,
ContentPageGtk* page);
@@ -65,16 +69,20 @@ class ContentPageGtk : public OptionsPageBase {
GtkWidget* passwords_asktosave_radio_;
GtkWidget* passwords_neversave_radio_;
- // Widget for the Form Autofill group.
+ // Widgets for the Form Autofill group.
GtkWidget* form_autofill_asktosave_radio_;
GtkWidget* form_autofill_neversave_radio_;
+ // Widgets for the Themes group.
+ GtkWidget* system_title_bar_checkbox_;
+
// The parent GtkTable widget
GtkWidget* page_;
// Pref members.
BooleanPrefMember ask_to_save_passwords_;
BooleanPrefMember ask_to_save_form_autofill_;
+ BooleanPrefMember use_custom_chrome_frame_;
// Flag to ignore gtk callbacks while we are loading prefs, to avoid
// then turning around and saving them again.