Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/ui/collected_cookies_infobar_delegate.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming back to GetIcon() Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/infobars/infobar_service.h" 8 #include "chrome/browser/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 15 // static
16 void CollectedCookiesInfoBarDelegate::Create(InfoBarService* infobar_service) { 16 void CollectedCookiesInfoBarDelegate::Create(InfoBarService* infobar_service) {
17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( 17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
18 new CollectedCookiesInfoBarDelegate(infobar_service))); 18 new CollectedCookiesInfoBarDelegate(infobar_service)));
19 } 19 }
20 20
21 CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate( 21 CollectedCookiesInfoBarDelegate::CollectedCookiesInfoBarDelegate(
22 InfoBarService* infobar_service) 22 InfoBarService* infobar_service)
23 : ConfirmInfoBarDelegate(infobar_service) { 23 : ConfirmInfoBarDelegate(infobar_service) {
24 } 24 }
25 25
26 gfx::Image* CollectedCookiesInfoBarDelegate::GetIcon() const { 26 int CollectedCookiesInfoBarDelegate::GetIconID() const {
27 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 27 return IDR_INFOBAR_COOKIE;
28 IDR_INFOBAR_COOKIE);
29 } 28 }
30 29
31 InfoBarDelegate::Type CollectedCookiesInfoBarDelegate::GetInfoBarType() const { 30 InfoBarDelegate::Type CollectedCookiesInfoBarDelegate::GetInfoBarType() const {
32 return PAGE_ACTION_TYPE; 31 return PAGE_ACTION_TYPE;
33 } 32 }
34 33
35 string16 CollectedCookiesInfoBarDelegate::GetMessageText() const { 34 string16 CollectedCookiesInfoBarDelegate::GetMessageText() const {
36 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE); 35 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_MESSAGE);
37 } 36 }
38 37
39 int CollectedCookiesInfoBarDelegate::GetButtons() const { 38 int CollectedCookiesInfoBarDelegate::GetButtons() const {
40 return BUTTON_OK; 39 return BUTTON_OK;
41 } 40 }
42 41
43 string16 CollectedCookiesInfoBarDelegate::GetButtonLabel( 42 string16 CollectedCookiesInfoBarDelegate::GetButtonLabel(
44 InfoBarButton button) const { 43 InfoBarButton button) const {
45 DCHECK_EQ(BUTTON_OK, button); 44 DCHECK_EQ(BUTTON_OK, button);
46 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON); 45 return l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_INFOBAR_BUTTON);
47 } 46 }
48 47
49 bool CollectedCookiesInfoBarDelegate::Accept() { 48 bool CollectedCookiesInfoBarDelegate::Accept() {
50 web_contents()->GetController().Reload(true); 49 web_contents()->GetController().Reload(true);
51 return true; 50 return true;
52 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698