diff options
Diffstat (limited to 'chrome/browser/views/clear_browsing_data.cc')
-rw-r--r-- | chrome/browser/views/clear_browsing_data.cc | 12 |
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) { |