chromium/chrome/browser/lookalikes/safety_tip_ui.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_LOOKALIKES_SAFETY_TIP_UI_H_
#define CHROME_BROWSER_LOOKALIKES_SAFETY_TIP_UI_H_

#include "base/functional/callback.h"
#include "build/build_config.h"
#include "components/security_state/core/security_state.h"

namespace content {
class WebContents;
}

class GURL;

// Represents the different user interactions with a Safety Tip dialog.
//
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Keep in sync with
// SafetyTipInteraction in enums.xml.
enum class SafetyTipInteraction {};

// Shows Safety Tip UI using the specified information if it is not already
// showing. |suggested_url| is the URL that Chrome thinks the user may have
// wanted to navigate to (if applicable). |close_callback| will be called when
// the dialog is closed; the argument indicates the action that the user took
// (if any) to close the dialog. Implemented in platform-specific files.
void ShowSafetyTipDialog(
    content::WebContents* web_contents,
    security_state::SafetyTipStatus type,
    const GURL& suggested_url,
    base::OnceCallback<void(SafetyTipInteraction)> close_callback);

#endif  // CHROME_BROWSER_LOOKALIKES_SAFETY_TIP_UI_H_