diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 01:37:19 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 01:37:19 +0000 |
commit | 25364e14c155d8eb3015f6be95af264a82ea2158 (patch) | |
tree | 4c5048d9ba7f979894d1e9c4d1723cc8e85759db /chrome/browser/views/clear_browsing_data.cc | |
parent | 3af08941db12e58b76361cda8cf313d529471b35 (diff) | |
download | chromium_src-25364e14c155d8eb3015f6be95af264a82ea2158.zip chromium_src-25364e14c155d8eb3015f6be95af264a82ea2158.tar.gz chromium_src-25364e14c155d8eb3015f6be95af264a82ea2158.tar.bz2 |
Implement clear browsing data dialog in linux
As well, refactored code on the windows side to reuse some functionality for the deletion range specified by its time period.
BUG=11192 (http://crbug.com/11192)
TEST=Looks pretty
Review URL: http://codereview.chromium.org/113558
Patch from Mohamed Mansour <m0.interactive@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/clear_browsing_data.cc')
-rw-r--r-- | chrome/browser/views/clear_browsing_data.cc | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index 1b4f517..865ba21 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -19,9 +19,6 @@ #include "views/standard_layout.h" #include "views/window/window.h" -using base::Time; -using base::TimeDelta; - // The combo box is vertically aligned to the 'time-period' label, which makes // the combo box look a little too close to the check box above it when we use // standard layout to separate them. We therefore add a little extra margin to @@ -399,19 +396,7 @@ static bool IsCheckBoxEnabledAndSelected(views::Checkbox* cb) { } void ClearBrowsingDataView::OnDelete() { - TimeDelta diff; - Time delete_begin = Time::Now(); - int period_selected = time_period_combobox_->GetSelectedItem(); - switch (period_selected) { - case 0: diff = TimeDelta::FromHours(24); break; // Last day. - case 1: diff = TimeDelta::FromHours(7*24); break; // Last week. - case 2: diff = TimeDelta::FromHours(4*7*24); break; // Four weeks. - case 3: delete_begin = Time(); break; // Everything. - default: NOTREACHED() << L"Missing item"; break; - } - - delete_begin = delete_begin - diff; int remove_mask = 0; if (IsCheckBoxEnabledAndSelected(del_history_checkbox_)) @@ -431,8 +416,9 @@ void ClearBrowsingDataView::OnDelete() { UpdateControlEnabledState(); // BrowsingDataRemover deletes itself when done. - remover_ = - new BrowsingDataRemover(profile_, delete_begin, Time()); + remover_ = new BrowsingDataRemover(profile_, + static_cast<BrowsingDataRemover::TimePeriod>(period_selected), + base::Time()); remover_->AddObserver(this); remover_->Remove(remove_mask); } |