Commit 2a4990fb authored by Yann Dago's avatar Yann Dago Committed by Commit Bot

Managment WebUI: Safe browsing is now a link

In the chrome://management page, the "Safe browsing" text that appears
in the browser reporting section is now a link to the safe browsing
page.

Bug: 936558
Change-Id: I88cc056e19b1cde29ae62cbd7e450cfb5fc8c6a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1492731
Commit-Queue: Yann Dago <ydago@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarThiemo Nagel <tnagel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638004}
parent c43c7764
......@@ -193,9 +193,9 @@
<div class="content-indented browser-report">
<iron-icon icon="[[item.icon]]"></iron-icon>
<ul>
<template is="dom-repeat" items="[[item.messages]]"
as="message">
<li>[[message]]</li>
<template is="dom-repeat" items="[[item.messageIds]]"
as="messageId">
<li inner-h-t-m-l="[[i18nAdvanced(messageId)]]"></li>
</template>
</ul>
</div>
......
......@@ -5,7 +5,7 @@
/**
* @typedef {{
* messages: !Array<string>,
* messageIds: !Array<string>,
* icon: string,
* }}
*/
......@@ -93,10 +93,9 @@ Polymer({
const reportingInfoMap = reportingInfo.reduce((info, response) => {
info[response.reportingType] = info[response.reportingType] || {
icon: this.getIconForReportingType_(response.reportingType),
messages: []
messageIds: []
};
info[response.reportingType].messages.push(
loadTimeData.getString(response.messageId));
info[response.reportingType].messageIds.push(response.messageId);
return info;
}, {});
......
......@@ -454,6 +454,7 @@ jumbo_split_static_library("ui") {
"//components/renderer_context_menu",
"//components/resources",
"//components/safe_browsing:features",
"//components/safe_browsing/common:common",
"//components/safe_browsing/common:safe_browsing_prefs",
"//components/safe_browsing/db:database_manager",
"//components/safe_browsing/db:util",
......
......@@ -15,6 +15,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/safe_browsing/common/safebrowsing_constants.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "extensions/buildflags/buildflags.h"
......@@ -99,8 +100,6 @@ content::WebUIDataSource* CreateManagementUIHtmlSource() {
IDS_MANAGEMENT_EXTENSION_REPORT_VERSION},
{kManagementExtensionReportExtensionsPlugin,
IDS_MANAGEMENT_EXTENSION_REPORT_EXTENSIONS_PLUGINS},
{kManagementExtensionReportSafeBrowsingWarnings,
IDS_MANAGEMENT_EXTENSION_REPORT_SAFE_BROWSING_WARNINGS},
{kManagementExtensionReportPerfCrash,
IDS_MANAGEMENT_EXTENSION_REPORT_PERF_CRASH},
{kManagementExtensionReportUserBrowsingData,
......@@ -111,6 +110,11 @@ content::WebUIDataSource* CreateManagementUIHtmlSource() {
AddLocalizedStringsBulk(source, kLocalizedStrings,
base::size(kLocalizedStrings));
source->AddString(kManagementExtensionReportSafeBrowsingWarnings,
l10n_util::GetStringFUTF16(
IDS_MANAGEMENT_EXTENSION_REPORT_SAFE_BROWSING_WARNINGS,
base::UTF8ToUTF16(safe_browsing::kSafeBrowsingUrl)));
#if BUILDFLAG(ENABLE_EXTENSIONS)
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
......
......@@ -130,7 +130,7 @@
Information about installed extensions and plugins
</message>
<message name="IDS_MANAGEMENT_EXTENSION_REPORT_SAFE_BROWSING_WARNINGS" desc="Message explaining that an extension currently reports the user's safe browsing warnings and ignored warnings">
Safe Browsing warnings
<ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Safe Browsing<ph name="END_LINK">&lt;/a&gt;</ph> warnings
</message>
<message name="IDS_MANAGEMENT_EXTENSION_REPORT_USER_BROWSING_DATA" desc="Message explaining that an extension currently reports the user's browsing data">
Websites you visit and time spent on them
......
......@@ -16,24 +16,8 @@ const base::FilePath::CharType kCookiesFile[] = FILE_PATH_LITERAL(" Cookies");
const base::FilePath::CharType kChannelIDFile[] =
FILE_PATH_LITERAL(" Channel IDs");
// The default URL prefix where browser fetches chunk updates, hashes,
// and reports safe browsing hits and malware details.
const char kSbDefaultURLPrefix[] =
"https://safebrowsing.google.com/safebrowsing";
// The backup URL prefix used when there are issues establishing a connection
// with the server at the primary URL.
const char kSbBackupConnectErrorURLPrefix[] =
"https://alt1-safebrowsing.google.com/safebrowsing";
// The backup URL prefix used when there are HTTP-specific issues with the
// server at the primary URL.
const char kSbBackupHttpErrorURLPrefix[] =
"https://alt2-safebrowsing.google.com/safebrowsing";
// The backup URL prefix used when there are local network specific issues.
const char kSbBackupNetworkErrorURLPrefix[] =
"https://alt3-safebrowsing.google.com/safebrowsing";
// The URL for the Safe Browsing page.
const char kSafeBrowsingUrl[] = "https://safebrowsing.google.com/";
const char kCustomCancelReasonForURLLoader[] = "SafeBrowsing";
......
......@@ -15,20 +15,8 @@ extern const base::FilePath::CharType kSafeBrowsingBaseFilename[];
extern const base::FilePath::CharType kCookiesFile[];
extern const base::FilePath::CharType kChannelIDFile[];
// The default URL prefix where browser fetches chunk updates, hashes,
// and reports safe browsing hits and malware details.
extern const char kSbDefaultURLPrefix[];
// The backup URL prefix used when there are issues establishing a connection
// with the server at the primary URL.
extern const char kSbBackupConnectErrorURLPrefix[];
// The backup URL prefix used when there are HTTP-specific issues with the
// server at the primary URL.
extern const char kSbBackupHttpErrorURLPrefix[];
// The backup URL prefix used when there are local network specific issues.
extern const char kSbBackupNetworkErrorURLPrefix[];
// The URL for the Safe Browsing page.
extern const char kSafeBrowsingUrl[];
// When a network::mojom::URLLoader is cancelled because of SafeBrowsing, this
// custom cancellation reason could be used to notify the implementation side.
......@@ -36,7 +24,7 @@ extern const char kSbBackupNetworkErrorURLPrefix[];
// details.
extern const char kCustomCancelReasonForURLLoader[];
// Returns the error_code to use when safe browsing blocks a request.
// Returns the error_code to use when Safe Browsing blocks a request.
int GetNetErrorCodeForSafeBrowsing();
}
......
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