Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 2 | // 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 Wennborg | 1790e6b | 2020-04-24 19:10:33 | [diff] [blame] | 7 | #include "base/check_op.h" |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 8 | #include "build/build_config.h" |
Colin Blundell | 77efe6c | 2021-04-30 07:32:40 | [diff] [blame] | 9 | #include "chrome/browser/infobars/confirm_infobar_creator.h" |
thestig | 884a160 | 2014-08-27 01:29:39 | [diff] [blame] | 10 | #include "chrome/grit/generated_resources.h" |
Colin Blundell | e70a6d8 | 2021-05-04 12:03:19 | [diff] [blame] | 11 | #include "components/infobars/content/content_infobar_manager.h" |
[email protected] | 051655ad | 2014-04-18 15:09:41 | [diff] [blame] | 12 | #include "components/infobars/core/infobar.h" |
Clark DuVall | 217fad8a | 2020-02-19 19:58:00 | [diff] [blame] | 13 | #include "components/vector_icons/vector_icons.h" |
[email protected] | 83ff91c | 2012-01-05 20:54:13 | [diff] [blame] | 14 | #include "content/public/browser/web_contents.h" |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 15 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | bd0690ee | 2013-07-22 18:35:59 | [diff] [blame] | 16 | |
[email protected] | 0be0993 | 2013-01-08 02:03:50 | [diff] [blame] | 17 | // static |
Colin Blundell | e70a6d8 | 2021-05-04 12:03:19 | [diff] [blame] | 18 | void CollectedCookiesInfoBarDelegate::Create( |
19 | infobars::ContentInfoBarManager* infobar_manager) { | ||||
20 | infobar_manager->AddInfoBar( | ||||
Colin Blundell | 77efe6c | 2021-04-30 07:32:40 | [diff] [blame] | 21 | CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>( |
[email protected] | 39308cb | 2013-12-06 03:01:48 | [diff] [blame] | 22 | new CollectedCookiesInfoBarDelegate()))); |
[email protected] | 0be0993 | 2013-01-08 02:03:50 | [diff] [blame] | 23 | } |
24 | |||||
Dana Fried | 789c731f | 2024-06-07 00:41:56 | [diff] [blame] | 25 | CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate() = default; |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 26 | |
Sorin Jianu | 7648695 | 2024-11-28 04:21:50 | [diff] [blame] | 27 | CollectedCookiesInfoBarDelegate::~CollectedCookiesInfoBarDelegate() = default; |
[email protected] | a24c929 | 2013-07-11 23:40:42 | [diff] [blame] | 28 | |
dfalcantara | ac4d93b | 2015-12-30 20:07:24 | [diff] [blame] | 29 | infobars::InfoBarDelegate::InfoBarIdentifier |
30 | CollectedCookiesInfoBarDelegate::GetIdentifier() const { | ||||
31 | return COLLECTED_COOKIES_INFOBAR_DELEGATE; | ||||
32 | } | ||||
33 | |||||
estade | bd85908 | 2017-02-24 21:53:43 | [diff] [blame] | 34 | const gfx::VectorIcon& CollectedCookiesInfoBarDelegate::GetVectorIcon() const { |
Dana Fried | 789c731f | 2024-06-07 00:41:56 | [diff] [blame] | 35 | return vector_icons::kSettingsChromeRefreshIcon; |
estade | 3feb83f | 2015-09-01 23:00:49 | [diff] [blame] | 36 | } |
37 | |||||
Jan Wilken Dörrie | 3f97e29 | 2021-03-11 18:07:14 | [diff] [blame] | 38 | std::u16string CollectedCookiesInfoBarDelegate::GetMessageText() const { |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 39 | return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE); |
40 | } | ||||
41 | |||||
42 | int CollectedCookiesInfoBarDelegate::GetButtons() const { | ||||
43 | return BUTTON_OK; | ||||
44 | } | ||||
45 | |||||
Jan Wilken Dörrie | 3f97e29 | 2021-03-11 18:07:14 | [diff] [blame] | 46 | std::u16string CollectedCookiesInfoBarDelegate::GetButtonLabel( |
[email protected] | e3c31d27 | 2011-05-05 02:12:10 | [diff] [blame] | 47 | InfoBarButton button) const { |
[email protected] |