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

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

Issue 2506473002: Page Info (Views): Change "Details" link (sec. panel) to "Learn more" (help center). (Closed)
Patch Set: Update comment. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | components/pageinfo_strings.grdp » ('j') | components/pageinfo_strings.grdp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f182aabb5062b633a24b9fe0f81990f7708ac258..7c926a87ace645d17d3787e02157d6e36d8293d2 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
@@ -130,8 +130,7 @@ class PopupHeaderView : public views::View {
void SetSummary(const base::string16& summary_text);
// Sets the security details for the current page.
- void SetDetails(const base::string16& details_text,
- bool include_details_link);
+ void SetDetails(const base::string16& details_text);
void AddResetDecisionsLabel();
@@ -143,7 +142,8 @@ class PopupHeaderView : public views::View {
views::Label* summary_label_;
// The label that displays the status of the identity check for this site.
- // Includes a link to open the DevTools Security panel.
+ // Includes a link to open the Chrome Help Center article about connection
+ // security.
views::StyledLabel* details_label_;
// A container for the styled label with a link for resetting cert decisions.
@@ -273,33 +273,28 @@ void PopupHeaderView::SetSummary(const base::string16& summary_text) {
summary_label_->SetText(summary_text);
}
-void PopupHeaderView::SetDetails(const base::string16& details_text,
- bool include_details_label_link) {
- if (include_details_label_link) {
- base::string16 details_link_text =
- l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_DETAILS_LINK);
+void PopupHeaderView::SetDetails(const base::string16& details_text) {
+ base::string16 learn_more_text =
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_LEARN_MORE);
msw 2016/11/15 01:56:07 nit: inline below, nix |learn_more_text|
lgarron 2016/11/29 02:12:02 Done.
- std::vector<base::string16> subst;
- subst.push_back(details_text);
- subst.push_back(details_link_text);
+ std::vector<base::string16> subst;
+ subst.push_back(details_text);
+ subst.push_back(learn_more_text);
- std::vector<size_t> offsets;
+ std::vector<size_t> offsets;
- base::string16 text = base::ReplaceStringPlaceholders(
- base::ASCIIToUTF16("$1 $2"), subst, &offsets);
- details_label_->SetText(text);
- gfx::Range details_range(offsets[1], text.length());
+ base::string16 text = base::ReplaceStringPlaceholders(
+ base::ASCIIToUTF16("$1 $2"), subst, &offsets);
+ details_label_->SetText(text);
+ gfx::Range details_range(offsets[1], text.length());
- views::StyledLabel::RangeStyleInfo link_style =
- views::StyledLabel::RangeStyleInfo::CreateForLink();
- if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
- link_style.font_style |= gfx::Font::FontStyle::UNDERLINE;
- link_style.disable_line_wrapping = false;
+ views::StyledLabel::RangeStyleInfo link_style =
+ views::StyledLabel::RangeStyleInfo::CreateForLink();
+ if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
+ link_style.font_style |= gfx::Font::FontStyle::UNDERLINE;
+ link_style.disable_line_wrapping = false;
- details_label_->AddStyleRange(details_range, link_style);
- } else {
- details_label_->SetText(details_text);
- }
+ details_label_->AddStyleRange(details_range, link_style);
}
void PopupHeaderView::AddResetDecisionsLabel() {
@@ -724,9 +719,7 @@ void WebsiteSettingsPopupView::SetIdentityInfo(
header_->AddResetDecisionsLabel();
}
- bool include_details_link = !is_devtools_disabled_ || certificate_;
-
- header_->SetDetails(security_description->details, include_details_link);
+ header_->SetDetails(security_description->details);
Layout();
SizeToContents();
@@ -786,20 +779,12 @@ void WebsiteSettingsPopupView::StyledLabelLinkClicked(views::StyledLabel* label,
int event_flags) {
switch (label->id()) {
case STYLED_LABEL_SECURITY_DETAILS:
+ web_contents()->OpenURL(content::OpenURLParams(
+ GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
+ false));
presenter_->RecordWebsiteSettingsAction(
- WebsiteSettings::WEBSITE_SETTINGS_SECURITY_DETAILS_OPENED);
msw 2016/11/15 01:56:07 Deprecate this and WEBSITE_SETTINGS_CERTIFICATE_DI
lgarron 2016/11/29 02:12:02 I've made a separate CL for this: https://coderevi
-
- if (is_devtools_disabled_) {
- DCHECK(certificate_);
- gfx::NativeWindow parent =
- anchor_widget() ? anchor_widget()->GetNativeWindow() : nullptr;
- presenter_->RecordWebsiteSettingsAction(
- WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED);
- ShowCertificateViewer(web_contents(), parent, certificate_.get());
- } else {
- DevToolsWindow::OpenDevToolsWindow(
- web_contents(), DevToolsToggleAction::ShowSecurityPanel());
- }
+ WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED);
break;
case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
presenter_->OnRevokeSSLErrorBypassButtonPressed();
« no previous file with comments | « no previous file | components/pageinfo_strings.grdp » ('j') | components/pageinfo_strings.grdp » ('J')

Powered by Google App Engine
This is Rietveld 408576698