blob: 0bd0d4fe1f0addea6fe35f79a1cec80eb467a59e [file] [log] [blame]
[email protected]1f4a69f92011-03-19 14:26:201// 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]95a33ed62011-09-30 15:07:088#include "chrome/browser/infobars/infobar_tab_helper.h"
[email protected]1f4a69f92011-03-19 14:26:209#include "content/browser/tab_contents/tab_contents.h"
10#include "grit/generated_resources.h"
[email protected]6e4baff2011-04-29 18:07:5511#include "grit/theme_resources_standard.h"
[email protected]1f4a69f92011-03-19 14:26:2012#include "ui/base/l10n/l10n_util.h"
13#include "ui/base/resource/resource_bundle.h"
14
15CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate(
[email protected]95a33ed62011-09-30 15:07:0816 InfoBarTabHelper* infobar_helper)
17 : ConfirmInfoBarDelegate(infobar_helper) {
[email protected]1f4a69f92011-03-19 14:26:2018}
19
[email protected]cf4d5a22011-04-21 22:46:2220gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const {
21 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
22 IDR_INFOBAR_COOKIE);
[email protected]1f4a69f92011-03-19 14:26:2023}
24
25InfoBarDelegate::Type CollectedCookiesInfoBarDelegate::GetInfoBarType() const {
26 return PAGE_ACTION_TYPE;
27}
28
29string16 CollectedCookiesInfoBarDelegate::GetMessageText() const {
30 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE);
31}
32
33int CollectedCookiesInfoBarDelegate::GetButtons() const {
34 return BUTTON_OK;
35}
36
[email protected]e3c31d272011-05-05 02:12:1037string16 CollectedCookiesInfoBarDelegate::GetButtonLabel(
38 InfoBarButton button) const {
[email protected]1f4a69f92011-03-19 14:26:2039 DCHECK_EQ(BUTTON_OK, button);
40 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON);
41}
42
43bool CollectedCookiesInfoBarDelegate::Accept() {
[email protected]10b833e2011-12-21 17:36:3044 owner()->tab_contents()->controller().Reload(true);
[email protected]1f4a69f92011-03-19 14:26:2045 return true;
46}