Joe DeBlasio | 7d60492 | 2019-08-08 19:56:36 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Emily Stark | 474b8ca | 2019-10-24 15:35:39 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_ |
| 6 | #define CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_ |
Joe DeBlasio | 7d60492 | 2019-08-08 19:56:36 | [diff] [blame] | 7 | |
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Emily Stark | 474b8ca | 2019-10-24 15:35:39 | [diff] [blame] | 10 | #include "chrome/browser/reputation/safety_tip_ui.h" |
Emily Stark | f1d38b9 | 2019-08-28 17:19:33 | [diff] [blame] | 11 | #include "components/security_state/core/security_state.h" |
Joe DeBlasio | 08d5235e | 2019-09-27 00:51:02 | [diff] [blame] | 12 | #include "url/gurl.h" |
Emily Stark | 4aee894 | 2019-09-05 15:34:21 | [diff] [blame] | 13 | |
| 14 | namespace content { |
| 15 | class WebContents; |
| 16 | } |
Joe DeBlasio | 7d60492 | 2019-08-08 19:56:36 | [diff] [blame] | 17 | |
Joe DeBlasio | 896fcc6 | 2020-08-04 19:32:48 | [diff] [blame] | 18 | // Navigates to either |safe_url| (when !is_empty()), or a safe default |
Joe DeBlasio | 5d78e040 | 2020-09-22 23:18:56 | [diff] [blame] | 19 | // otherwise, replacing the current page in the process. Invoked when 'leave |
| 20 | // site' button is clicked. |
Emily Stark | 53b2989 | 2019-10-24 16:30:41 | [diff] [blame] | 21 | void LeaveSiteFromSafetyTip(content::WebContents* web_contents, |
| 22 | const GURL& safe_url); |
Joe DeBlasio | 7d60492 | 2019-08-08 19:56:36 | [diff] [blame] | 23 | |
Joe DeBlasio | 5d78e040 | 2020-09-22 23:18:56 | [diff] [blame] | 24 | // Opens the Help Center URL when 'Learn more' button is clicked. |
Emily Stark | 53b2989 | 2019-10-24 16:30:41 | [diff] [blame] | 25 | void OpenHelpCenterFromSafetyTip(content::WebContents* web_contents); |
Joe DeBlasio | 29a2ab2 | 2019-10-04 23:47:10 | [diff] [blame] | 26 | |
Joe DeBlasio | 08d5235e | 2019-09-27 00:51:02 | [diff] [blame] | 27 | // Get the titles, descriptions, and button strings or IDs needed to describe |
| 28 | // the applicable warning type. Handles both Android and desktop warnings. |
Joe DeBlasio | 72ff3ce6 | 2020-08-08 01:37:55 | [diff] [blame] | 29 | // |suggested_url| is the suggested URL to navigate to, used in some strings. |
Jan Wilken Dörrie | dec9912 | 2021-03-11 18:02:30 | [diff] [blame] | 30 | std::u16string GetSafetyTipTitle(security_state::SafetyTipStatus warning_type, |
Joe DeBlasio | 7677f480 | 2019-10-18 00:50:56 | [diff] [blame] | 31 | const GURL& suggested_url); |
Jan Wilken Dörrie | dec9912 | 2021-03-11 18:02:30 | [diff] [blame] | 32 | std::u16string GetSafetyTipDescription( |
Joe DeBlasio | 29a2ab2 | 2019-10-04 23:47:10 | [diff] [blame] | 33 | security_state::SafetyTipStatus warning_type, |
Joe DeBlasio | 7677f480 | 2019-10-18 00:50:56 | [diff] [blame] | 34 | const GURL& suggested_url); |
Joe DeBlasio | 08d5235e | 2019-09-27 00:51:02 | [diff] [blame] | 35 | int GetSafetyTipLeaveButtonId(security_state::SafetyTipStatus warning_type); |
Joe DeBlasio | 7d60492 | 2019-08-08 19:56:36 | [diff] [blame] | 36 | |
Emily Stark | 474b8ca | 2019-10-24 15:35:39 | [diff] [blame] | 37 | #endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_ |