[M87] Open security page when enhanced protection link is clicked.
Implement OpenEnhancedProtectionSettings() in controller_client. Create
an interface named settings_page_helper at component/ level and an
implementation class named chrome_settings_page_helper at chrome/ level.
The interface is injected to controller_client.
Add Safe Browsing enhanced protection page in chrome_pages. The URL
path is "security?q=enhanced". During navigation, it opens
"chrome://settings/security" and expands the enhanced protection section.
(cherry picked from commit 4ada215142fd8bf16cd98909ed3a3c526f52d3ff)
Bug: 1130721
Change-Id: I27b9b938d47c8ea4caed2b4da6e9b374086366e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429440
Commit-Queue: Xinghui Lu <[email protected]>
Reviewed-by: Nate Fischer <[email protected]>
Reviewed-by: Carlos IL <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Reviewed-by: Alexei Svitkine <[email protected]>
Reviewed-by: Livvie Lin <[email protected]>
Reviewed-by: Varun Khaneja <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#813879}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466366
Reviewed-by: Xinghui Lu <[email protected]>
Cr-Commit-Position: refs/branch-heads/4280@{#269}
Cr-Branched-From: ea420fb963f9658c9969b6513c56b8f47efa1a2a-refs/heads/master@{#812852}
diff --git a/chrome/browser/interstitials/chrome_settings_page_helper.h b/chrome/browser/interstitials/chrome_settings_page_helper.h
new file mode 100644
index 0000000..6f8f1ed
--- /dev/null
+++ b/chrome/browser/interstitials/chrome_settings_page_helper.h
@@ -0,0 +1,40 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_INTERSTITIALS_CHROME_SETTINGS_PAGE_HELPER_H_
+#define CHROME_BROWSER_INTERSTITIALS_CHROME_SETTINGS_PAGE_HELPER_H_
+
+#include <memory>
+
+#include "components/security_interstitials/content/settings_page_helper.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace security_interstitials {
+
+// This class is used to open a Chrome setting page in a security interstitial.
+// The implementation is different on desktop platforms and on Android. On
+// desktop, it opens a new tab and navigation to chrome://settings/*.
+// TODO(crbug.com/1130721): On Android, it creates an intent to launch a
+// Settings activity.
+class ChromeSettingsPageHelper : public SettingsPageHelper {
+ public:
+ static std::unique_ptr<security_interstitials::SettingsPageHelper>
+ CreateChromeSettingsPageHelper();
+
+ ChromeSettingsPageHelper() = default;
+ ~ChromeSettingsPageHelper() override = default;
+ ChromeSettingsPageHelper(const ChromeSettingsPageHelper&) = delete;
+ ChromeSettingsPageHelper& operator=(const ChromeSettingsPageHelper&) = delete;
+
+ // SettingsPageHelper:
+ void OpenEnhancedProtectionSettings(
+ content::WebContents* web_contents) const override;
+};
+
+} // namespace security_interstitials
+
+#endif // CHROME_BROWSER_INTERSTITIALS_CHROME_SETTINGS_PAGE_HELPER_H_