#ifndef CHROME_BROWSER_UI_OMNIBOX_ALTERNATE_NAV_INFOBAR_DELEGATE_H_
#define CHROME_BROWSER_UI_OMNIBOX_ALTERNATE_NAV_INFOBAR_DELEGATE_H_
#include <stddef.h>
#include <memory>
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "components/infobars/core/infobar_delegate.h"
#include "components/omnibox/browser/autocomplete_match.h"
class Profile;
namespace content {
class WebContents;
}
class AlternateNavInfoBarDelegate : public infobars::InfoBarDelegate {
public:
AlternateNavInfoBarDelegate(const AlternateNavInfoBarDelegate&) = delete;
AlternateNavInfoBarDelegate& operator=(const AlternateNavInfoBarDelegate&) =
delete;
~AlternateNavInfoBarDelegate() override;
static void CreateForOmniboxNavigation(content::WebContents* web_contents,
const std::u16string& text,
const AutocompleteMatch& match,
const GURL& search_url);
std::u16string GetMessageTextWithOffset(size_t* link_offset) const;
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
const gfx::VectorIcon& GetVectorIcon() const override;
std::u16string GetLinkText() const override;
GURL GetLinkURL() const override;
bool LinkClicked(WindowOpenDisposition disposition) override;
private:
AlternateNavInfoBarDelegate(Profile* profile,
const std::u16string& text,
std::unique_ptr<AutocompleteMatch> match,
const GURL& destination_url,
const GURL& original_url);
static std::unique_ptr<infobars::InfoBar> CreateInfoBar(
std::unique_ptr<AlternateNavInfoBarDelegate> delegate);
raw_ptr<Profile> profile_;
const std::u16string text_;
std::unique_ptr<AutocompleteMatch> match_;
const GURL destination_url_;
const GURL original_url_;
};
#endif