summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cookie_modal_dialog_gtk.cc
diff options
context:
space:
mode:
authorskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 22:50:31 +0000
committerskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 22:50:31 +0000
commitb7e991c273b3666a4ffb73b79a20a569580dfa84 (patch)
tree6564641c02c1af6a7a24dba1a1b5e4947afcfdc7 /chrome/browser/cookie_modal_dialog_gtk.cc
parenta7b29dd44da31770cdea6b298957a6a25446e8a9 (diff)
downloadchromium_src-b7e991c273b3666a4ffb73b79a20a569580dfa84.zip
chromium_src-b7e991c273b3666a4ffb73b79a20a569580dfa84.tar.gz
chromium_src-b7e991c273b3666a4ffb73b79a20a569580dfa84.tar.bz2
Make kCookiePromptExpanded a profile pref rather than a local state pref so it can be synced.
BUG=40483 Review URL: http://codereview.chromium.org/2964003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookie_modal_dialog_gtk.cc')
-rw-r--r--chrome/browser/cookie_modal_dialog_gtk.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/cookie_modal_dialog_gtk.cc b/chrome/browser/cookie_modal_dialog_gtk.cc
index a5eef95..f00dc19 100644
--- a/chrome/browser/cookie_modal_dialog_gtk.cc
+++ b/chrome/browser/cookie_modal_dialog_gtk.cc
@@ -14,22 +14,13 @@
#include "chrome/browser/gtk/gtk_chrome_link_button.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/pref_service.h"
+#include "chrome/browser/profile.h"
#include "chrome/browser/views/cookie_prompt_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
-namespace {
-
-void OnExpanderActivate(GtkExpander* expander) {
- g_browser_process->local_state()->
- SetBoolean(prefs::kCookiePromptExpanded,
- gtk_expander_get_expanded(GTK_EXPANDER(expander)));
-}
-
-} // namespace
-
void CookiePromptModalDialog::CreateAndShowDialog() {
dialog_ = CreateNativeDialog();
gtk_util::ShowModalDialogWithMinLocalizedWidth(GTK_WIDGET(dialog_),
@@ -92,11 +83,10 @@ NativeDialog CookiePromptModalDialog::CreateNativeDialog() {
GtkWidget* expander = gtk_expander_new(
l10n_util::GetStringUTF8(IDS_COOKIE_SHOW_DETAILS_LABEL).c_str());
gtk_expander_set_expanded(GTK_EXPANDER(expander),
- g_browser_process->local_state()->
+ tab_contents_->profile()->GetPrefs()->
GetBoolean(prefs::kCookiePromptExpanded));
g_signal_connect(expander, "notify::expanded",
- G_CALLBACK(OnExpanderActivate), NULL);
-
+ G_CALLBACK(OnExpanderActivateThunk), this);
cookie_view_ = gtk_chrome_cookie_view_new(TRUE);
gtk_chrome_cookie_view_clear(GTK_CHROME_COOKIE_VIEW(cookie_view_));
if (type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE) {
@@ -156,3 +146,10 @@ void CookiePromptModalDialog::HandleDialogResponse(GtkDialog* dialog,
gtk_util::AppModalDismissedUngroupWindows();
delete this;
}
+
+void CookiePromptModalDialog::OnExpanderActivate(GtkWidget* expander,
+ GParamSpec* property) {
+ tab_contents_->profile()->GetPrefs()->
+ SetBoolean(prefs::kCookiePromptExpanded,
+ gtk_expander_get_expanded(GTK_EXPANDER(expander)));
+}