summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/clear_browsing_data.cc
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-25 15:48:28 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-25 15:48:28 +0000
commitc8e234f12d0ab9c50a1665c0a9d2fae9b5623f3e (patch)
treed9aa1986ec2f1a67fc8aaea63d585755fff815b7 /chrome/browser/views/clear_browsing_data.cc
parentbb43f33a8d466bb3783a10e726f9e348ca6350bd (diff)
downloadchromium_src-c8e234f12d0ab9c50a1665c0a9d2fae9b5623f3e.zip
chromium_src-c8e234f12d0ab9c50a1665c0a9d2fae9b5623f3e.tar.gz
chromium_src-c8e234f12d0ab9c50a1665c0a9d2fae9b5623f3e.tar.bz2
Remember the clear browsing data combo box selection.
(Checking in for external contributer Arthur Lussos <developer0420@gmail.com>, who is already listed in AUTHORS) Reviewed at http://codereview.chromium.org/7946 Review URL: http://codereview.chromium.org/7993 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/clear_browsing_data.cc')
-rw-r--r--chrome/browser/views/clear_browsing_data.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc
index 0b2b6f5..c4c88f4 100644
--- a/chrome/browser/views/clear_browsing_data.cc
+++ b/chrome/browser/views/clear_browsing_data.cc
@@ -98,6 +98,9 @@ void ClearBrowsingDataView::Init() {
// 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 @@ std::wstring ClearBrowsingDataView::GetItemAt(views::ComboBox* source,
}
////////////////////////////////////////////////////////////////////////////////
+// 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) {