Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: chrome/browser/views/options/cookie_filter_page_view.cc

Issue 560024: Reland 37913. Clear local state on exit. (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/options/cookie_filter_page_view.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/cookie_filter_page_view.cc
diff --git a/chrome/browser/views/options/cookie_filter_page_view.cc b/chrome/browser/views/options/cookie_filter_page_view.cc
index a7ec4508002917c9db381b78beac10f2874ab7f3..835282ff632d2889fa18d2080aca92e6dacc66be 100644
--- a/chrome/browser/views/options/cookie_filter_page_view.cc
+++ b/chrome/browser/views/options/cookie_filter_page_view.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/views/options/cookies_view.h"
#include "chrome/browser/views/options/exceptions_view.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "views/controls/button/checkbox.h"
@@ -32,6 +33,8 @@ CookieFilterPageView::CookieFilterPageView(Profile* profile)
clear_on_close_check_(NULL),
show_cookies_button_(NULL),
OptionsPageView(profile) {
+ clear_site_data_on_exit_.Init(prefs::kClearSiteDataOnExit,
+ profile->GetPrefs(), NULL);
}
CookieFilterPageView::~CookieFilterPageView() {
@@ -128,8 +131,6 @@ void CookieFilterPageView::InitControlLayout() {
l10n_util::GetString(IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX));
clear_on_close_check_->set_listener(this);
- // TODO(pkasting): Set clear-on-close checkbox to be checked or not.
-
layout->StartRow(0, single_column_set_id);
layout->AddView(clear_on_close_check_);
layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
@@ -151,6 +152,13 @@ void CookieFilterPageView::InitControlLayout() {
GridLayout::FILL);
}
+void CookieFilterPageView::NotifyPrefChanged(const std::wstring* pref_name) {
+ if (!pref_name || *pref_name == prefs::kClearSiteDataOnExit) {
+ clear_on_close_check_->SetChecked(
+ clear_site_data_on_exit_.GetValue());
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
// CookieFilterPageView, views::ButtonListener implementation:
@@ -173,7 +181,7 @@ void CookieFilterPageView::ButtonPressed(
} else if (sender == block_3rdparty_check_) {
settings_map->SetBlockThirdPartyCookies(block_3rdparty_check_->checked());
} else if (sender == clear_on_close_check_) {
- // TODO(pkasting): Set clear-on-close setting.
+ clear_site_data_on_exit_.SetValue(clear_on_close_check_->checked());
} else {
DCHECK_EQ(sender, show_cookies_button_);
UserMetricsRecordAction("Options_ShowCookies", NULL);
« no previous file with comments | « chrome/browser/views/options/cookie_filter_page_view.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698