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

Unified Diff: chrome/browser/views/clear_browsing_data.cc

Issue 7946: Remember the clear browsing data combo box selection. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 2 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/clear_browsing_data.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/clear_browsing_data.cc
===================================================================
--- chrome/browser/views/clear_browsing_data.cc (revision 3843)
+++ chrome/browser/views/clear_browsing_data.cc (working copy)
@@ -98,6 +98,9 @@
// Add the combo box showing how far back in time we want to delete.
time_period_combobox_ = new views::ComboBox(this);
+ time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger(
+ prefs::kDeleteTimePeriod));
+ time_period_combobox_->SetListener(this);
AddChildView(time_period_combobox_);
}
@@ -302,6 +305,15 @@
}
////////////////////////////////////////////////////////////////////////////////
+// ClearBrowsingDataView, views::ComboBoxListener implementation:
+
+void ClearBrowsingDataView::ItemChanged(views::ComboBox* sender,
+ int prev_index, int new_index) {
+ if (sender == time_period_combobox_ && prev_index != new_index)
+ profile_->GetPrefs()->SetInteger(prefs::kDeleteTimePeriod, new_index);
+}
+
+////////////////////////////////////////////////////////////////////////////////
// ClearBrowsingDataView, views::ButtonListener implementation:
void ClearBrowsingDataView::ButtonPressed(views::NativeButton* sender) {
« no previous file with comments | « chrome/browser/views/clear_browsing_data.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698