blob: b248773e0180005372c5acb4d8628c26a2a9b81d [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2012 The Chromium Authors
[email protected]1f4a69f92011-03-19 14:26:202// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
6
Hans Wennborg1790e6b2020-04-24 19:10:337#include "base/check_op.h"
avi655876a2015-12-25 07:18:158#include "build/build_config.h"
Colin Blundell77efe6c2021-04-30 07:32:409#include "chrome/browser/infobars/confirm_infobar_creator.h"
thestig884a1602014-08-27 01:29:3910#include "chrome/grit/generated_resources.h"
Colin Blundelle70a6d82021-05-04 12:03:1911#include "components/infobars/content/content_infobar_manager.h"
[email protected]051655ad2014-04-18 15:09:4112#include "components/infobars/core/infobar.h"
Clark DuVall217fad8a2020-02-19 19:58:0013#include "components/vector_icons/vector_icons.h"
[email protected]83ff91c2012-01-05 20:54:1314#include "content/public/browser/web_contents.h"
[email protected]1f4a69f92011-03-19 14:26:2015#include "ui/base/l10n/l10n_util.h"
[email protected]bd0690ee2013-07-22 18:35:5916
[email protected]0be09932013-01-08 02:03:5017// static
Colin Blundelle70a6d82021-05-04 12:03:1918void CollectedCookiesInfoBarDelegate::Create(
19 infobars::ContentInfoBarManager* infobar_manager) {
20 infobar_manager->AddInfoBar(
Colin Blundell77efe6c2021-04-30 07:32:4021 CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>(
[email protected]39308cb2013-12-06 03:01:4822 new CollectedCookiesInfoBarDelegate())));
[email protected]0be09932013-01-08 02:03:5023}
24
Dana Fried789c731f2024-06-07 00:41:5625CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate() = default;
[email protected]1f4a69f92011-03-19 14:26:2026
Sorin Jianu76486952024-11-28 04:21:5027CollectedCookiesInfoBarDelegate::~CollectedCookiesInfoBarDelegate() = default;
[email protected]a24c9292013-07-11 23:40:4228
dfalcantaraac4d93b2015-12-30 20:07:2429infobars::InfoBarDelegate::InfoBarIdentifier
30CollectedCookiesInfoBarDelegate::GetIdentifier() const {
31 return COLLECTED_COOKIES_INFOBAR_DELEGATE;
32}
33
estadebd859082017-02-24 21:53:4334const gfx::VectorIcon& CollectedCookiesInfoBarDelegate::GetVectorIcon() const {
Dana Fried789c731f2024-06-07 00:41:5635 return vector_icons::kSettingsChromeRefreshIcon;
estade3feb83f2015-09-01 23:00:4936}
37
Jan Wilken Dörrie3f97e292021-03-11 18:07:1438std::u16string CollectedCookiesInfoBarDelegate::GetMessageText() const {
[email protected]1f4a69f92011-03-19 14:26:2039 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE);
40}
41
42int CollectedCookiesInfoBarDelegate::GetButtons() const {
43 return BUTTON_OK;
44}
45
Jan Wilken Dörrie3f97e292021-03-11 18:07:1446std::u16string CollectedCookiesInfoBarDelegate::GetButtonLabel(
[email protected]e3c31d272011-05-05 02:12:1047 InfoBarButton button) const {
[email protected]