Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
index 3d2a10dada4d4418708d6028aee98cb63a31f82a..dac253a230d2750b6bbb711dd855c480d3f76d55 100644 |
--- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
+++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
@@ -21,6 +21,7 @@ |
#include "components/content_settings/core/common/content_settings_types.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/cert_store.h" |
+#include "content/public/browser/ssl_host_state.h" |
#include "content/public/browser/user_metrics.h" |
#include "grit/chromium_strings.h" |
#include "grit/generated_resources.h" |
@@ -310,6 +311,7 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView( |
identity_info_content_(NULL), |
certificate_dialog_link_(NULL), |
signed_certificate_timestamps_link_(NULL), |
+ reset_decisions_button_(NULL), |
cert_id_(0), |
help_center_link_(NULL), |
connection_info_content_(NULL), |
@@ -378,12 +380,6 @@ void WebsiteSettingsPopupView::OnWidgetDestroying(views::Widget* widget) { |
presenter_->OnUIClosing(); |
} |
-void WebsiteSettingsPopupView::ButtonPressed( |
- views::Button* button, |
- const ui::Event& event) { |
- GetWidget()->Close(); |
-} |
- |
void WebsiteSettingsPopupView::LinkClicked(views::Link* source, |
int event_flags) { |
// The popup closes automatically when the collected cookies dialog or the |
@@ -395,6 +391,16 @@ void WebsiteSettingsPopupView::LinkClicked(views::Link* source, |
weak_factory_.GetWeakPtr(), source)); |
} |
+void WebsiteSettingsPopupView::ButtonPressed(views::Button* button, |
+ const ui::Event& event) { |
+ content::BrowserThread::PostTask( |
+ content::BrowserThread::UI, |
+ FROM_HERE, |
+ base::Bind(&WebsiteSettingsPopupView::HandleButtonPressedAsync, |
Peter Kasting
2014/08/06 01:19:07
Do you really need to do this asynchronously? The
jww
2014/08/06 17:58:18
This UI stuff is a bit of a mystery to me, and I w
|
+ weak_factory_.GetWeakPtr(), |
+ button)); |
+} |
+ |
void WebsiteSettingsPopupView::TabSelectedAt(int index) { |
tabbed_pane_->GetSelectedTab()->Layout(); |
SizeToContents(); |
@@ -556,6 +562,14 @@ void WebsiteSettingsPopupView::SetIdentityInfo( |
signed_certificate_timestamps_link_->set_listener(this); |
} |
+ if (identity_info.certificate_decision_made) { |
+ reset_decisions_button_ = new views::LabelButton( |
+ this, |
+ l10n_util::GetStringUTF16( |
+ IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON)); |
+ reset_decisions_button_->SetStyle(views::Button::STYLE_BUTTON); |
+ } |
+ |
headline = base::UTF8ToUTF16(identity_info.site_identity); |
} |
ResetConnectionSection( |
@@ -564,7 +578,8 @@ void WebsiteSettingsPopupView::SetIdentityInfo( |
base::string16(), // The identity section has no headline. |
base::UTF8ToUTF16(identity_info.identity_status_description), |
certificate_dialog_link_, |
- signed_certificate_timestamps_link_); |
+ signed_certificate_timestamps_link_, |
+ reset_decisions_button_); |
ResetConnectionSection( |
connection_info_content_, |
@@ -572,6 +587,7 @@ void WebsiteSettingsPopupView::SetIdentityInfo( |
base::string16(), // The connection section has no headline. |
base::UTF8ToUTF16(identity_info.connection_status_description), |
NULL, |
+ NULL, |
NULL); |
connection_tab_->InvalidateLayout(); |
@@ -587,6 +603,7 @@ void WebsiteSettingsPopupView::SetFirstVisit( |
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE), |
first_visit, |
NULL, |
+ NULL, |
NULL); |
connection_tab_->InvalidateLayout(); |
Layout(); |
@@ -705,7 +722,8 @@ void WebsiteSettingsPopupView::ResetConnectionSection( |
const base::string16& headline, |
const base::string16& text, |
views::Link* link, |
- views::Link* secondary_link) { |
+ views::Link* secondary_link, |
+ views::LabelButton* reset_decisions_button) { |
section_container->RemoveAllChildViews(true); |
views::GridLayout* layout = new views::GridLayout(section_container); |
@@ -778,6 +796,11 @@ void WebsiteSettingsPopupView::ResetConnectionSection( |
content_layout->AddView(secondary_link); |
} |
+ if (reset_decisions_button) { |
+ content_layout->StartRow(1, 0); |
+ content_layout->AddView(reset_decisions_button); |
+ } |
+ |
layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, |
views::GridLayout::LEADING); |
layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); |
@@ -809,3 +832,12 @@ void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) { |
false)); |
} |
} |
+ |
+void WebsiteSettingsPopupView::HandleButtonPressedAsync(views::Button* button) { |
+ if (button == reset_decisions_button_) { |
+ content::BrowserContext* context = web_contents_->GetBrowserContext(); |
+ content::SSLHostState host_state(context); |
+ host_state.RevokeAllowAndDenyPreferencesHard(presenter_->site_url().host()); |
+ GetWidget()->Close(); |
+ } |
+} |