diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 05:05:24 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 05:05:24 +0000 |
commit | 8f51d68fb92cd74f374edc44347abe5000cbd2ec (patch) | |
tree | 48f8820cfc3019d421286cc2f70e9877696a7d86 /chrome/browser/views/clear_browsing_data.cc | |
parent | bd92c3aee82e619df3526b4d971b706ab070167c (diff) | |
download | chromium_src-8f51d68fb92cd74f374edc44347abe5000cbd2ec.zip chromium_src-8f51d68fb92cd74f374edc44347abe5000cbd2ec.tar.gz chromium_src-8f51d68fb92cd74f374edc44347abe5000cbd2ec.tar.bz2 |
Adds "Delete Local Storage" option to "Clear Browsing Data" for Windows and GTK.
NOTE: This change does not contain src/chrome/app/nibs/ClearBrowsingData.xib. It'll be edited by someone who knows about Mac.
BUG=none
TEST=The clear browser data dialog box should have a new option: Delete local storage"
Landing for Marcus
Original CL: http://codereview.chromium.org/524026
Review URL: http://codereview.chromium.org/542048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36098 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 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index 8b94636..54bb6e7 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -44,6 +44,7 @@ ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) : del_history_checkbox_(NULL), del_downloads_checkbox_(NULL), del_cache_checkbox_(NULL), + del_local_storage_checkbox_(NULL), del_cookies_checkbox_(NULL), del_passwords_checkbox_(NULL), del_form_data_checkbox_(NULL), @@ -94,6 +95,10 @@ void ClearBrowsingDataView::Init() { AddCheckbox(l10n_util::GetString(IDS_DEL_CACHE_CHKBOX), profile_->GetPrefs()->GetBoolean(prefs::kDeleteCache)); + del_local_storage_checkbox_ = + AddCheckbox(l10n_util::GetString(IDS_DEL_LOCAL_STORAGE_CHKBOX), + profile_->GetPrefs()->GetBoolean(prefs::kDeleteLocalStorage)); + del_cookies_checkbox_ = AddCheckbox(l10n_util::GetString(IDS_DEL_COOKIES_CHKBOX), profile_->GetPrefs()->GetBoolean(prefs::kDeleteCookies)); @@ -158,10 +163,17 @@ void ClearBrowsingDataView::Layout() { kRelatedControlVerticalSpacing, sz.width(), sz.height()); + sz = del_local_storage_checkbox_->GetPreferredSize(); + del_local_storage_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_cache_checkbox_->y() + + del_cache_checkbox_->height() + + kRelatedControlVerticalSpacing, + sz.width(), sz.height()); + sz = del_cookies_checkbox_->GetPreferredSize(); del_cookies_checkbox_->SetBounds(2 * kPanelHorizMargin, - del_cache_checkbox_->y() + - del_cache_checkbox_->height() + + del_local_storage_checkbox_->y() + + del_local_storage_checkbox_->height() + kRelatedControlVerticalSpacing, sz.width(), sz.height()); @@ -268,6 +280,7 @@ bool ClearBrowsingDataView::IsDialogButtonEnabled( return del_history_checkbox_->checked() || del_downloads_checkbox_->checked() || del_cache_checkbox_->checked() || + del_local_storage_checkbox_->checked() || del_cookies_checkbox_->checked() || del_passwords_checkbox_->checked() || del_form_data_checkbox_->checked(); @@ -354,6 +367,9 @@ void ClearBrowsingDataView::ButtonPressed( else if (sender == del_cache_checkbox_) profile_->GetPrefs()->SetBoolean(prefs::kDeleteCache, del_cache_checkbox_->checked() ? true : false); + else if (sender == del_local_storage_checkbox_) + profile_->GetPrefs()->SetBoolean(prefs::kDeleteLocalStorage, + del_local_storage_checkbox_->checked() ? true : false); else if (sender == del_cookies_checkbox_) profile_->GetPrefs()->SetBoolean(prefs::kDeleteCookies, del_cookies_checkbox_->checked() ? true : false); @@ -387,6 +403,7 @@ void ClearBrowsingDataView::UpdateControlEnabledState() { del_history_checkbox_->SetEnabled(!delete_in_progress_); del_downloads_checkbox_->SetEnabled(!delete_in_progress_); del_cache_checkbox_->SetEnabled(!delete_in_progress_); + del_local_storage_checkbox_->SetEnabled(!delete_in_progress_); del_cookies_checkbox_->SetEnabled(!delete_in_progress_); del_passwords_checkbox_->SetEnabled(!delete_in_progress_); del_form_data_checkbox_->SetEnabled(!delete_in_progress_); @@ -425,6 +442,8 @@ void ClearBrowsingDataView::OnDelete() { remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; if (IsCheckBoxEnabledAndSelected(del_cache_checkbox_)) remove_mask |= BrowsingDataRemover::REMOVE_CACHE; + if (IsCheckBoxEnabledAndSelected(del_local_storage_checkbox_)) + remove_mask |= BrowsingDataRemover::REMOVE_LOCAL_STORAGE; delete_in_progress_ = true; UpdateControlEnabledState(); |