blob: f87713d75e712f03fbcc31f955fe68da3683c4b6 [file] [log] [blame]
Joe DeBlasio7d604922019-08-08 19:56:361// 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 Stark474b8ca2019-10-24 15:35:395#ifndef CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_
6#define CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_
Joe DeBlasio7d604922019-08-08 19:56:367
Jan Wilken Dörriead587c32021-03-11 14:09:278#include <string>
9
Emily Stark474b8ca2019-10-24 15:35:3910#include "chrome/browser/reputation/safety_tip_ui.h"
Emily Starkf1d38b92019-08-28 17:19:3311#include "components/security_state/core/security_state.h"
Joe DeBlasio08d5235e2019-09-27 00:51:0212#include "url/gurl.h"
Emily Stark4aee8942019-09-05 15:34:2113
14namespace content {
15class WebContents;
16}
Joe DeBlasio7d604922019-08-08 19:56:3617
Joe DeBlasio896fcc62020-08-04 19:32:4818// Navigates to either |safe_url| (when !is_empty()), or a safe default
Joe DeBlasio5d78e0402020-09-22 23:18:5619// otherwise, replacing the current page in the process. Invoked when 'leave
20// site' button is clicked.
Emily Stark53b29892019-10-24 16:30:4121void LeaveSiteFromSafetyTip(content::WebContents* web_contents,
22 const GURL& safe_url);
Joe DeBlasio7d604922019-08-08 19:56:3623
Joe DeBlasio5d78e0402020-09-22 23:18:5624// Opens the Help Center URL when 'Learn more' button is clicked.
Emily Stark53b29892019-10-24 16:30:4125void OpenHelpCenterFromSafetyTip(content::WebContents* web_contents);
Joe DeBlasio29a2ab22019-10-04 23:47:1026
Joe DeBlasio08d5235e2019-09-27 00:51:0227// Get the titles, descriptions, and button strings or IDs needed to describe
28// the applicable warning type. Handles both Android and desktop warnings.
Joe DeBlasio72ff3ce62020-08-08 01:37:5529// |suggested_url| is the suggested URL to navigate to, used in some strings.
Jan Wilken Dörriedec99122021-03-11 18:02:3030std::u16string GetSafetyTipTitle(security_state::SafetyTipStatus warning_type,
Joe DeBlasio7677f4802019-10-18 00:50:5631 const GURL& suggested_url);
Jan Wilken Dörriedec99122021-03-11 18:02:3032std::u16string GetSafetyTipDescription(
Joe DeBlasio29a2ab22019-10-04 23:47:1033 security_state::SafetyTipStatus warning_type,
Joe DeBlasio7677f4802019-10-18 00:50:5634 const GURL& suggested_url);
Joe DeBlasio08d5235e2019-09-27 00:51:0235int GetSafetyTipLeaveButtonId(security_state::SafetyTipStatus warning_type);
Joe DeBlasio7d604922019-08-08 19:56:3636
Emily Stark474b8ca2019-10-24 15:35:3937#endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_