blob: c76cc16f0e691e298fed0ecbe559d68fe6e02918 [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
Joe DeBlasio08d5235e2019-09-27 00:51:028#include "base/strings/string16.h"
Emily Stark474b8ca2019-10-24 15:35:399#include "chrome/browser/reputation/safety_tip_ui.h"
Emily Starkf1d38b92019-08-28 17:19:3310#include "components/security_state/core/security_state.h"
Joe DeBlasio08d5235e2019-09-27 00:51:0211#include "url/gurl.h"
Emily Stark4aee8942019-09-05 15:34:2112
13namespace content {
14class WebContents;
15}
Joe DeBlasio7d604922019-08-08 19:56:3616
Joe DeBlasio896fcc62020-08-04 19:32:4817// Navigates to either |safe_url| (when !is_empty()), or a safe default
Joe DeBlasio5d78e0402020-09-22 23:18:5618// otherwise, replacing the current page in the process. Invoked when 'leave
19// site' button is clicked.
Emily Stark53b29892019-10-24 16:30:4120void LeaveSiteFromSafetyTip(content::WebContents* web_contents,
21 const GURL& safe_url);
Joe DeBlasio7d604922019-08-08 19:56:3622
Joe DeBlasio5d78e0402020-09-22 23:18:5623// Opens the Help Center URL when 'Learn more' button is clicked.
Emily Stark53b29892019-10-24 16:30:4124void OpenHelpCenterFromSafetyTip(content::WebContents* web_contents);
Joe DeBlasio29a2ab22019-10-04 23:47:1025
Joe DeBlasio08d5235e2019-09-27 00:51:0226// Get the titles, descriptions, and button strings or IDs needed to describe
27// the applicable warning type. Handles both Android and desktop warnings.
Joe DeBlasio72ff3ce62020-08-08 01:37:5528// |suggested_url| is the suggested URL to navigate to, used in some strings.
Joe DeBlasio08d5235e2019-09-27 00:51:0229base::string16 GetSafetyTipTitle(security_state::SafetyTipStatus warning_type,
Joe DeBlasio7677f4802019-10-18 00:50:5630 const GURL& suggested_url);
Joe DeBlasio29a2ab22019-10-04 23:47:1031base::string16 GetSafetyTipDescription(
32 security_state::SafetyTipStatus warning_type,
Joe DeBlasio7677f4802019-10-18 00:50:5633 const GURL& suggested_url);
Joe DeBlasio08d5235e2019-09-27 00:51:0234int GetSafetyTipLeaveButtonId(security_state::SafetyTipStatus warning_type);
Joe DeBlasio7d604922019-08-08 19:56:3635
Emily Stark474b8ca2019-10-24 15:35:3936#endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_UI_HELPER_H_