Commit 9cf604aa authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Change learn more link for Advanced Protection download warnings

When an Advanced Protection user sees a warning, we should send them
to the AP-specific FAQ page, which will include details about what kinds
of files show warnings for that population.

Bug: 917190
Change-Id: I12156cb502c04c9bd826b112a692e979e4e4d0f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635206Reviewed-by: default avatarNathan Parker <nparker@chromium.org>
Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666140}
parent 3f565ebe
......@@ -656,7 +656,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommands* download_commands,
(sb_service ? sb_service->download_protection_service() : nullptr);
if (protection_service)
protection_service->ShowDetailsForDownload(
*download_, download_commands->GetBrowser());
download_, download_commands->GetBrowser());
#else
// Should only be getting invoked if we are using safe browsing.
NOTREACHED();
......
......@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h"
#include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager.h"
#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h"
#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
#include "chrome/browser/safe_browsing/download_protection/download_url_sb_client.h"
......@@ -281,14 +282,27 @@ void DownloadProtectionService::PPAPIDownloadCheckRequestFinished(
}
void DownloadProtectionService::ShowDetailsForDownload(
const download::DownloadItem& item,
const download::DownloadItem* item,
content::PageNavigator* navigator) {
GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL);
learn_more_url = google_util::AppendGoogleLocaleParam(
learn_more_url, g_browser_process->GetApplicationLocale());
learn_more_url = net::AppendQueryParameter(
learn_more_url, "ctx",
base::NumberToString(static_cast<int>(item.GetDangerType())));
base::NumberToString(static_cast<int>(item->GetDangerType())));
Profile* profile = Profile::FromBrowserContext(
content::DownloadItemUtils::GetBrowserContext(item));
if (profile &&
AdvancedProtectionStatusManager::RequestsAdvancedProtectionVerdicts(
profile) &&
item->GetDangerType() ==
download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT) {
learn_more_url = GURL(chrome::kAdvancedProtectionDownloadLearnMoreURL);
learn_more_url = google_util::AppendGoogleLocaleParam(
learn_more_url, g_browser_process->GetApplicationLocale());
}
navigator->OpenURL(
content::OpenURLParams(learn_more_url, content::Referrer(),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
......
......@@ -102,7 +102,7 @@ class DownloadProtectionService {
// Display more information to the user regarding the download specified by
// |info|. This method is invoked when the user requests more information
// about a download that was marked as malicious.
void ShowDetailsForDownload(const download::DownloadItem& item,
void ShowDetailsForDownload(const download::DownloadItem* item,
content::PageNavigator* navigator);
// Enables or disables the service. This is usually called by the
......
......@@ -2227,7 +2227,7 @@ TEST_F(DownloadProtectionServiceTest, ShowDetailsForDownloadHasContext) {
.WillOnce(Return(download::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST));
EXPECT_CALL(mock_page_navigator, OpenURL(OpenURLParamsWithContextValue("7")));
download_service_->ShowDetailsForDownload(mock_download_item,
download_service_->ShowDetailsForDownload(&mock_download_item,
&mock_page_navigator);
}
......
......@@ -12,6 +12,9 @@ const char kAccessibilityLabelsLearnMoreURL[] =
const char kAutomaticSettingsResetLearnMoreURL[] =
"https://support.google.com/chrome/?p=ui_automatic_settings_reset";
const char kAdvancedProtectionDownloadLearnMoreURL[] =
"https://support.google.com/accounts/?p=ap_faq";
const char kBluetoothAdapterOffHelpURL[] =
#if defined(OS_CHROMEOS)
"chrome://settings/?search=bluetooth";
......
......@@ -33,6 +33,9 @@ extern const char kAccessibilityLabelsLearnMoreURL[];
// "Learn more" URL for when profile settings are automatically reset.
extern const char kAutomaticSettingsResetLearnMoreURL[];
// "Learn more" URL for Advanced Protection download warnings.
extern const char kAdvancedProtectionDownloadLearnMoreURL[];
// The URL for providing help when the Bluetooth adapter is off.
extern const char kBluetoothAdapterOffHelpURL[];
......
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