Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 418133012: Add button to page info to revoke user certificate decisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..627cba0280036ac760a88b171a26698406cda32d 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
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/website_settings/website_settings_utils.h"
#include "chrome/common/url_constants.h"
#include "components/content_settings/core/common/content_settings_types.h"
+#include "content/browser/ssl/ssl_host_state.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cert_store.h"
#include "content/public/browser/user_metrics.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),
@@ -381,7 +383,6 @@ void WebsiteSettingsPopupView::OnWidgetDestroying(views::Widget* widget) {
void WebsiteSettingsPopupView::ButtonPressed(
views::Button* button,
const ui::Event& event) {
Peter Kasting 2014/07/26 02:40:39 Why do we still have this function if it's empty?
jww 2014/07/27 17:29:26 The removal of GetWidget()->Close(); is an acciden
- GetWidget()->Close();
}
void WebsiteSettingsPopupView::LinkClicked(views::Link* source,
@@ -556,6 +557,12 @@ void WebsiteSettingsPopupView::SetIdentityInfo(
signed_certificate_timestamps_link_->set_listener(this);
}
+ if (identity_info.certificate_decision_made) {
+ reset_decisions_button_ = new views::Link(l10n_util::GetStringUTF16(
+ IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON));
+ reset_decisions_button_->set_listener(this);
+ }
+
headline = base::UTF8ToUTF16(identity_info.site_identity);
}
ResetConnectionSection(
@@ -564,7 +571,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 +580,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 +596,7 @@ void WebsiteSettingsPopupView::SetFirstVisit(
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE),
first_visit,
NULL,
+ NULL,
NULL);
connection_tab_->InvalidateLayout();
Layout();
@@ -705,7 +715,8 @@ void WebsiteSettingsPopupView::ResetConnectionSection(
const base::string16& headline,
const base::string16& text,
views::Link* link,
- views::Link* secondary_link) {
+ views::Link* secondary_link,
+ views::Link* reset_decisions_button) {
section_container->RemoveAllChildViews(true);
views::GridLayout* layout = new views::GridLayout(section_container);
@@ -778,6 +789,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);
@@ -807,5 +823,10 @@ void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) {
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false));
+ } else if (source == reset_decisions_button_) {
+ content::BrowserContext* context = web_contents_->GetBrowserContext();
+ content::SSLHostState::GetFor(context)
+ ->RevokeAllowAndDenyPreferences(presenter_->GetSiteURL().host());
Peter Kasting 2014/07/26 02:40:39 Nit: Wrap like this: content::SSLHostState::G
jww 2014/07/27 17:29:26 This is actually a git-cl format change. Happy to
Peter Kasting 2014/07/28 11:07:44 I'm not sure I'd say "strong" preference, but I've
jww 2014/07/28 19:10:00 Done.
+ GetWidget()->Close();
}
}

Powered by Google App Engine
This is Rietveld 408576698