diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:17:44 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 00:17:44 +0000 |
commit | b7dbbec00aa43f94a078f2e5852601fb725d4b4b (patch) | |
tree | 12405dbbd5de879c940cc2b86a02ce0cb5ae8ef7 /chrome/browser/views/clear_browsing_data.cc | |
parent | 32ba74abd684923faaa26a1e717765af07d7a7bb (diff) | |
download | chromium_src-b7dbbec00aa43f94a078f2e5852601fb725d4b4b.zip chromium_src-b7dbbec00aa43f94a078f2e5852601fb725d4b4b.tar.gz chromium_src-b7dbbec00aa43f94a078f2e5852601fb725d4b4b.tar.bz2 |
Strict transport security: add checkbox to clear state.
This patches add a checkbox to the "Clear Browsing Data" dialog which
clears the STS state when checked. Since we don't timestamp our
entries (for now at least, should we?), the duration selected has no
effect: we always clear everything.
Mac doesn't appear to have a dialog for this yet, so no Mac specific
changes.
http://codereview.chromium.org/196070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25955 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 | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index 385095a..e5716e5 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -47,6 +47,7 @@ ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) del_cookies_checkbox_(NULL), del_passwords_checkbox_(NULL), del_form_data_checkbox_(NULL), + del_sts_checkbox_(NULL), time_period_label_(NULL), time_period_combobox_(NULL), delete_in_progress_(false), @@ -106,6 +107,10 @@ void ClearBrowsingDataView::Init() { AddCheckbox(l10n_util::GetString(IDS_DEL_FORM_DATA_CHKBOX), profile_->GetPrefs()->GetBoolean(prefs::kDeleteFormData)); + del_sts_checkbox_ = + AddCheckbox(l10n_util::GetString(IDS_DEL_STS_STATE), + profile_->GetPrefs()->GetBoolean(prefs::kDeleteSTSState)); + // Add a label which appears before the combo box for the time period. time_period_label_ = new views::Label( l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); @@ -179,11 +184,18 @@ void ClearBrowsingDataView::Layout() { kRelatedControlVerticalSpacing, sz.width(), sz.height()); + sz = del_sts_checkbox_->GetPreferredSize(); + del_sts_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_form_data_checkbox_->y() + + del_form_data_checkbox_->height() + + kRelatedControlVerticalSpacing, + sz.width(), sz.height()); + // Time period label is next below the combo boxes. sz = time_period_label_->GetPreferredSize(); time_period_label_->SetBounds(kPanelHorizMargin, - del_form_data_checkbox_->y() + - del_form_data_checkbox_->height() + + del_sts_checkbox_->y() + + del_sts_checkbox_->height() + kRelatedControlVerticalSpacing + kExtraMarginForTimePeriodLabel, sz.width(), sz.height()); @@ -266,7 +278,8 @@ bool ClearBrowsingDataView::IsDialogButtonEnabled( del_cache_checkbox_->checked() || del_cookies_checkbox_->checked() || del_passwords_checkbox_->checked() || - del_form_data_checkbox_->checked(); + del_form_data_checkbox_->checked() || + del_sts_checkbox_->checked(); } return true; @@ -359,6 +372,9 @@ void ClearBrowsingDataView::ButtonPressed( else if (sender == del_form_data_checkbox_) profile_->GetPrefs()->SetBoolean(prefs::kDeleteFormData, del_form_data_checkbox_->checked() ? true : false); + else if (sender == del_sts_checkbox_) + profile_->GetPrefs()->SetBoolean(prefs::kDeleteSTSState, + del_sts_checkbox_->checked() ? true : false); // When no checkbox is checked we should not have the action button enabled. // This forces the button to evaluate what state they should be in. @@ -386,6 +402,7 @@ void ClearBrowsingDataView::UpdateControlEnabledState() { del_cookies_checkbox_->SetEnabled(!delete_in_progress_); del_passwords_checkbox_->SetEnabled(!delete_in_progress_); del_form_data_checkbox_->SetEnabled(!delete_in_progress_); + del_sts_checkbox_->SetEnabled(!delete_in_progress_); time_period_combobox_->SetEnabled(!delete_in_progress_); status_label_.SetVisible(delete_in_progress_); @@ -421,6 +438,8 @@ void ClearBrowsingDataView::OnDelete() { remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; if (IsCheckBoxEnabledAndSelected(del_cache_checkbox_)) remove_mask |= BrowsingDataRemover::REMOVE_CACHE; + if (IsCheckBoxEnabledAndSelected(del_sts_checkbox_)) + remove_mask |= BrowsingDataRemover::REMOVE_STS_STATE; delete_in_progress_ = true; UpdateControlEnabledState(); |