| Index: chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
|
| index 450e2f8267254ccb434154240d7ab692ead4a44a..52f858956314c5ccb42dc4499d37d16356449d65 100644
|
| --- a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
|
| @@ -24,6 +24,7 @@
|
| #include "chrome/common/url_constants.h"
|
| #include "content/public/browser/cert_store.h"
|
| #include "content/public/browser/page_navigator.h"
|
| +#include "content/public/browser/ssl_host_state.h"
|
| #include "content/public/browser/user_metrics.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "grit/chromium_strings.h"
|
| @@ -515,6 +516,14 @@ NSColor* IdentityVerifiedTextColor() {
|
| ShowCertificateViewerByID(webContents_, [self parentWindow], certificateId_);
|
| }
|
|
|
| +// Handler for the link button to revoke user certificate decisions.
|
| +- (void)resetCertificateDecisions:(id)sender {
|
| + DCHECK(resetDecisionsButton_);
|
| + content::BrowserContext* context = webContents_->GetBrowserContext();
|
| + content::SSLHostState::GetFor(context)->RevokeAllowAndDenyPreferences(
|
| + presenter_->GetSiteURL().host());
|
| +}
|
| +
|
| // Handler for the link to show help information about the connection tab.
|
| - (void)showHelpPage:(id)sender {
|
| webContents_->OpenURL(content::OpenURLParams(
|
| @@ -561,6 +570,7 @@ NSColor* IdentityVerifiedTextColor() {
|
| toView:contentView.get()
|
| atPoint:textPosition];
|
| certificateInfoButton_ = nil; // This will be created only if necessary.
|
| + resetDecisionsButton_ = nil; // This will be created only if necessary.
|
| separatorAfterConnection_ = [self addSeparatorToView:contentView];
|
| [separatorAfterConnection_ setAutoresizingMask:NSViewWidthSizable];
|
|
|
| @@ -659,6 +669,14 @@ NSColor* IdentityVerifiedTextColor() {
|
| [certificateInfoButton_ setFrame:certificateButtonFrame];
|
| yPos = NSMaxY(certificateButtonFrame);
|
| }
|
| + if (resetDecisionsButton_) {
|
| + NSRect resetDecisionsButtonFrame = [resetDecisionsButton_ frame];
|
| + resetDecisionsButtonFrame.origin.x =
|
| + NSMinX([identityStatusDescriptionField_ frame]);
|
| + resetDecisionsButtonFrame.origin.y = yPos + kVerticalSpacing;
|
| + [resetDecisionsButton_ setFrame:resetDecisionsButtonFrame];
|
| + yPos = NSMaxY(resetDecisionsButtonFrame);
|
| + }
|
| yPos = [self setYPositionOfView:separatorAfterIdentity_
|
| to:yPos + kVerticalSpacing];
|
| yPos += kVerticalSpacing;
|
| @@ -997,6 +1015,18 @@ NSColor* IdentityVerifiedTextColor() {
|
| [certificateInfoButton_ setTarget:self];
|
| [certificateInfoButton_ setAction:@selector(showCertificateInfo:)];
|
| }
|
| +
|
| + // Check if a security decision has been made, and if so, add a button to
|
| + // allow the user to retract their decision.
|
| + if (identityInfo.certificate_decision_made) {
|
| + NSString* text = l10n_util::GetNSString(
|
| + IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON);
|
| + resetDecisionsButton_ =
|
| + [self addLinkButtonWithText:text toView:connectionTabContentView_];
|
| +
|
| + [resetDecisionsButton_ setTarget:self];
|
| + [resetDecisionsButton_ setAction:@selector(resetCertificateDecisions:)];
|
| + }
|
| } else {
|
| certificateInfoButton_ = nil;
|
| }
|
|
|