OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 5 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
14 | 14 |
| 15 // static |
| 16 void CollectedCookiesInfoBarDelegate::Create(InfoBarService* infobar_service) { |
| 17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 18 new CollectedCookiesInfoBarDelegate(infobar_service))); |
| 19 } |
| 20 |
15 CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate( | 21 CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate( |
16 InfoBarService* infobar_service) | 22 InfoBarService* infobar_service) |
17 : ConfirmInfoBarDelegate(infobar_service) { | 23 : ConfirmInfoBarDelegate(infobar_service) { |
18 } | 24 } |
19 | 25 |
20 gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const { | 26 gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const { |
21 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 27 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
22 IDR_INFOBAR_COOKIE); | 28 IDR_INFOBAR_COOKIE); |
23 } | 29 } |
24 | 30 |
(...skipping 12 matching lines...) Expand all Loading... |
37 string16 CollectedCookiesInfoBarDelegate::GetButtonLabel( | 43 string16 CollectedCookiesInfoBarDelegate::GetButtonLabel( |
38 InfoBarButton button) const { | 44 InfoBarButton button) const { |
39 DCHECK_EQ(BUTTON_OK, button); | 45 DCHECK_EQ(BUTTON_OK, button); |
40 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON); | 46 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON); |
41 } | 47 } |
42 | 48 |
43 bool CollectedCookiesInfoBarDelegate::Accept() { | 49 bool CollectedCookiesInfoBarDelegate::Accept() { |
44 owner()->GetWebContents()->GetController().Reload(true); | 50 owner()->GetWebContents()->GetController().Reload(true); |
45 return true; | 51 return true; |
46 } | 52 } |
OLD | NEW |