Commit 72f1f3a9 authored by Patti's avatar Patti Committed by Commit Bot

Desktop Page Info: Turn on --show-cert-link by default and delete the switch.

Since r503089 removed factory-default settings from the Page Info, there is now
room to always show page certificate information. This patch turns on the
--show-cert-link flag, which will do this, by default.

Bug: 718553
Change-Id: Ic293c720337d5638f6097b481cfa7bc341b6abdf
Reviewed-on: https://chromium-review.googlesource.com/686093
Commit-Queue: Patti <patricialor@chromium.org>
Reviewed-by: default avatarLucas Garron <lgarron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505295}
parent d02a1b81
......@@ -3178,12 +3178,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableOutOfProcessHeapProfilingDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableOutOfProcessHeapProfilingChoices)},
#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
{"show-cert-link", flag_descriptions::kShowCertLinkOnPageInfoName,
flag_descriptions::kShowCertLinkOnPageInfoDescription, kOsDesktop,
SINGLE_VALUE_TYPE(switches::kShowCertLink)},
#endif
{"omnibox-ui-elide-suggestion-url-after-host",
flag_descriptions::kOmniboxUIElideSuggestionUrlAfterHostName,
flag_descriptions::kOmniboxUIElideSuggestionUrlAfterHostDescription,
......
......@@ -2761,15 +2761,6 @@ const char kUiSlowAnimationsDescription[] = "Makes all UI animations slow.";
#endif // defined(USE_ASH)
#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
const char kShowCertLinkOnPageInfoName[] = "Show certificate link";
const char kShowCertLinkOnPageInfoDescription[] =
"Add a link from the Page Info bubble to the certificate viewer for HTTPS "
"sites.";
#endif // defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
#if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
const char kAutofillCreditCardUploadName[] =
......
......@@ -1704,13 +1704,6 @@ extern const char kUiSlowAnimationsDescription[];
#endif // defined(USE_ASH)
#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
extern const char kShowCertLinkOnPageInfoName[];
extern const char kShowCertLinkOnPageInfoDescription[];
#endif // defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
#if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
extern const char kAutofillCreditCardUploadName[];
......
......@@ -922,31 +922,30 @@ bool IsInternalURL(const GURL& url) {
}
}
if (PageInfoUI::ShouldShowCertificateLink()) {
bool isValid = (identityInfo.identity_status !=
PageInfo::SITE_IDENTITY_STATUS_ERROR);
NSString* linkText = l10n_util::GetNSString(
isValid ? IDS_PAGE_INFO_CERTIFICATE_VALID_LINK
: IDS_PAGE_INFO_CERTIFICATE_INVALID_LINK);
certificateView_ =
[self addInspectLinkToView:siteSettingsSectionView_
sectionIcon:NSImageFromImageSkia(
PageInfoUI::GetCertificateIcon())
sectionTitle:l10n_util::GetStringUTF16(
IDS_PAGE_INFO_CERTIFICATE)
linkText:linkText];
if (isValid) {
[certificateView_
setLinkToolTip:l10n_util::GetNSStringF(
IDS_PAGE_INFO_CERTIFICATE_VALID_LINK_TOOLTIP,
base::UTF8ToUTF16(
certificate_->issuer().GetDisplayName()))];
}
[certificateView_ setLinkTarget:self
withAction:@selector(showCertificateInfo:)];
// Show information about the page's certificate.
bool isValid =
(identityInfo.identity_status != PageInfo::SITE_IDENTITY_STATUS_ERROR);
NSString* linkText = l10n_util::GetNSString(
isValid ? IDS_PAGE_INFO_CERTIFICATE_VALID_LINK
: IDS_PAGE_INFO_CERTIFICATE_INVALID_LINK);
certificateView_ =
[self addInspectLinkToView:siteSettingsSectionView_
sectionIcon:NSImageFromImageSkia(
PageInfoUI::GetCertificateIcon())
sectionTitle:l10n_util::GetStringUTF16(
IDS_PAGE_INFO_CERTIFICATE)
linkText:linkText];
if (isValid) {
[certificateView_
setLinkToolTip:l10n_util::GetNSStringF(
IDS_PAGE_INFO_CERTIFICATE_VALID_LINK_TOOLTIP,
base::UTF8ToUTF16(
certificate_->issuer().GetDisplayName()))];
}
[certificateView_ setLinkTarget:self
withAction:@selector(showCertificateInfo:)];
}
if (identityInfo.show_change_password_buttons) {
changePasswordButton_ =
......
......@@ -464,12 +464,6 @@ const gfx::ImageSkia PageInfoUI::GetCertificateIcon() {
}
#endif
// static
bool PageInfoUI::ShouldShowCertificateLink() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kShowCertLink);
}
// static
bool PageInfoUI::ContentSettingsTypeInPageInfo(ContentSettingsType type) {
for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
......
......@@ -197,9 +197,6 @@ class PageInfoUI {
static const gfx::ImageSkia GetCertificateIcon();
#endif
// Returns true if the Certificate Viewer link should be shown.
static bool ShouldShowCertificateLink();
// Return true if the given ContentSettingsType is in PageInfoUI.
static bool ContentSettingsTypeInPageInfo(ContentSettingsType type);
......
......@@ -765,34 +765,33 @@ void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) {
header_->AddResetDecisionsLabel();
}
if (PageInfoUI::ShouldShowCertificateLink()) {
// The text of link to the Certificate Viewer varies depending on the
// validity of the Certificate.
const bool valid_identity = (identity_info.identity_status !=
PageInfo::SITE_IDENTITY_STATUS_ERROR);
const base::string16 link_title = l10n_util::GetStringUTF16(
valid_identity ? IDS_PAGE_INFO_CERTIFICATE_VALID_LINK
: IDS_PAGE_INFO_CERTIFICATE_INVALID_LINK);
// Create the link to add to the Certificate Section.
views::Link* certificate_viewer_link = new views::Link(link_title);
certificate_viewer_link->set_id(
PageInfoBubbleView::VIEW_ID_PAGE_INFO_LINK_CERTIFICATE_VIEWER);
certificate_viewer_link->set_listener(this);
certificate_viewer_link->SetUnderline(false);
if (valid_identity) {
certificate_viewer_link->SetTooltipText(l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_CERTIFICATE_VALID_LINK_TOOLTIP,
base::UTF8ToUTF16(certificate_->issuer().GetDisplayName())));
}
// Add the Certificate Section.
site_settings_view_->AddChildViewAt(
CreateInspectLinkSection(PageInfoUI::GetCertificateIcon(),
IDS_PAGE_INFO_CERTIFICATE,
certificate_viewer_link),
0);
// Show information about the page's certificate.
// The text of link to the Certificate Viewer varies depending on the
// validity of the Certificate.
const bool valid_identity =
(identity_info.identity_status != PageInfo::SITE_IDENTITY_STATUS_ERROR);
const base::string16 link_title = l10n_util::GetStringUTF16(
valid_identity ? IDS_PAGE_INFO_CERTIFICATE_VALID_LINK
: IDS_PAGE_INFO_CERTIFICATE_INVALID_LINK);
// Create the link to add to the Certificate Section.
views::Link* certificate_viewer_link = new views::Link(link_title);
certificate_viewer_link->set_id(
PageInfoBubbleView::VIEW_ID_PAGE_INFO_LINK_CERTIFICATE_VIEWER);
certificate_viewer_link->set_listener(this);
certificate_viewer_link->SetUnderline(false);
if (valid_identity) {
certificate_viewer_link->SetTooltipText(l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_CERTIFICATE_VALID_LINK_TOOLTIP,
base::UTF8ToUTF16(certificate_->issuer().GetDisplayName())));
}
// Add the Certificate Section.
site_settings_view_->AddChildViewAt(
CreateInspectLinkSection(PageInfoUI::GetCertificateIcon(),
IDS_PAGE_INFO_CERTIFICATE,
certificate_viewer_link),
0);
}
if (identity_info.show_change_password_buttons) {
......
......@@ -652,9 +652,6 @@ const char kSavePageAsMHTML[] = "save-page-as-mhtml";
// If true the app list will be shown.
const char kShowAppList[] = "show-app-list";
// If true the Certificate link will be shown in Page Info for HTTPS pages.
const char kShowCertLink[] = "show-cert-link";
// Does not show an infobar when an extension attaches to a page using
// chrome.debugger page. Required to attach to extension background pages.
const char kSilentDebuggerExtensionAPI[] = "silent-debugger-extension-api";
......
......@@ -191,7 +191,6 @@ extern const char kRemoteDebuggingTargets[];
extern const char kRestoreLastSession[];
extern const char kSavePageAsMHTML[];
extern const char kShowAppList[];
extern const char kShowCertLink[];
extern const char kSilentDebuggerExtensionAPI[];
extern const char kSilentLaunch[];
extern const char kSimulateCriticalUpdate[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment