[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | |||||
5 | #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | ||||
6 | |||||
7 | #include "base/logging.h" | ||||
[email protected] | 95a33ed6 | 2011-09-30 15:07:08 | [diff] [blame] | 8 | #include "chrome/browser/infobars/infobar_tab_helper.h" |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 9 | #include "content/browser/tab_contents/tab_contents.h" |
10 | #include "grit/generated_resources.h" | ||||
[email protected] | 6e4baff | 2011-04-29 18:07:55 | [diff] [blame] | 11 | #include "grit/theme_resources_standard.h" |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 12 | #include "ui/base/l10n/l10n_util.h" |
13 | #include "ui/base/resource/resource_bundle.h" | ||||
14 | |||||
15 | CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate( | ||||
[email protected] | 95a33ed6 | 2011-09-30 15:07:08 | [diff] [blame] | 16 | InfoBarTabHelper* infobar_helper) |
17 | : ConfirmInfoBarDelegate(infobar_helper) { | ||||
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 18 | } |
19 | |||||
[email protected] | cf4d5a2 | 2011-04-21 22:46:22 | [diff] [blame] | 20 | gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const { |
21 | return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | ||||
22 | IDR_INFOBAR_COOKIE); | ||||
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 23 | } |
24 | |||||
25 | InfoBarDelegate::Type CollectedCookiesInfoBarDelegate::GetInfoBarType() const { | ||||
26 | return PAGE_ACTION_TYPE; | ||||
27 | } | ||||
28 | |||||
29 | string16 CollectedCookiesInfoBarDelegate::GetMessageText() const { | ||||
30 | return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE); | ||||
31 | } | ||||
32 | |||||
33 | int CollectedCookiesInfoBarDelegate::GetButtons() const { | ||||
34 | return BUTTON_OK; | ||||
35 | } | ||||
36 | |||||
[email protected] | e3c31d27 | 2011-05-05 02:12:10 | [diff] [blame] | 37 | string16 CollectedCookiesInfoBarDelegate::GetButtonLabel( |
38 | InfoBarButton button) const { | ||||
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 39 | DCHECK_EQ(BUTTON_OK, button); |
40 | return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON); | ||||
41 | } | ||||
42 | |||||
43 | bool CollectedCookiesInfoBarDelegate::Accept() { | ||||
[email protected] | 10b833e | 2011-12-21 17:36:30 | [diff] [blame] | 44 | owner()->tab_contents()->controller().Reload(true); |
[email protected] | 1f4a69f9 | 2011-03-19 14:26:20 | [diff] [blame] | 45 | return true; |
46 | } |