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

Side by Side Diff: chrome/browser/ui/cocoa/keystone_infobar_delegate.mm

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/cocoa/keystone_infobar_delegate.h" 5 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 private: 46 private:
47 KeystonePromotionInfoBarDelegate(InfoBarService* infobar_service, 47 KeystonePromotionInfoBarDelegate(InfoBarService* infobar_service,
48 PrefService* prefs); 48 PrefService* prefs);
49 virtual ~KeystonePromotionInfoBarDelegate(); 49 virtual ~KeystonePromotionInfoBarDelegate();
50 50
51 // Sets this info bar to be able to expire. Called a predetermined amount 51 // Sets this info bar to be able to expire. Called a predetermined amount
52 // of time after this object is created. 52 // of time after this object is created.
53 void SetCanExpire() { can_expire_ = true; } 53 void SetCanExpire() { can_expire_ = true; }
54 54
55 // ConfirmInfoBarDelegate 55 // ConfirmInfoBarDelegate
56 virtual gfx::Image* GetIcon() const OVERRIDE; 56 virtual int GetIconID() const OVERRIDE;
57 virtual string16 GetMessageText() const OVERRIDE; 57 virtual string16 GetMessageText() const OVERRIDE;
58 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 58 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
59 virtual bool Accept() OVERRIDE; 59 virtual bool Accept() OVERRIDE;
60 virtual bool Cancel() OVERRIDE; 60 virtual bool Cancel() OVERRIDE;
61 virtual bool ShouldExpireInternal( 61 virtual bool ShouldExpireInternal(
62 const content::LoadCommittedDetails& details) const OVERRIDE; 62 const content::LoadCommittedDetails& details) const OVERRIDE;
63 63
64 // The prefs to use. 64 // The prefs to use.
65 PrefService* prefs_; // weak 65 PrefService* prefs_; // weak
66 66
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 base::TimeDelta::FromSeconds(8); 103 base::TimeDelta::FromSeconds(8);
104 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, 104 base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
105 base::Bind(&KeystonePromotionInfoBarDelegate::SetCanExpire, 105 base::Bind(&KeystonePromotionInfoBarDelegate::SetCanExpire,
106 weak_ptr_factory_.GetWeakPtr()), 106 weak_ptr_factory_.GetWeakPtr()),
107 kCanExpireOnNavigationAfterDelay); 107 kCanExpireOnNavigationAfterDelay);
108 } 108 }
109 109
110 KeystonePromotionInfoBarDelegate::~KeystonePromotionInfoBarDelegate() { 110 KeystonePromotionInfoBarDelegate::~KeystonePromotionInfoBarDelegate() {
111 } 111 }
112 112
113 gfx::Image* KeystonePromotionInfoBarDelegate::GetIcon() const { 113 int KeystonePromotionInfoBarDelegate::GetIconID() const {
114 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 114 return IDR_PRODUCT_LOGO_32;
115 IDR_PRODUCT_LOGO_32);
116 } 115 }
117 116
118 string16 KeystonePromotionInfoBarDelegate::GetMessageText() const { 117 string16 KeystonePromotionInfoBarDelegate::GetMessageText() const {
119 return l10n_util::GetStringFUTF16(IDS_PROMOTE_INFOBAR_TEXT, 118 return l10n_util::GetStringFUTF16(IDS_PROMOTE_INFOBAR_TEXT,
120 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 119 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
121 } 120 }
122 121
123 string16 KeystonePromotionInfoBarDelegate::GetButtonLabel( 122 string16 KeystonePromotionInfoBarDelegate::GetButtonLabel(
124 InfoBarButton button) const { 123 InfoBarButton button) const {
125 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? 124 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 223
225 @end // @implementation KeystonePromotionInfoBar 224 @end // @implementation KeystonePromotionInfoBar
226 225
227 // static 226 // static
228 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { 227 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) {
229 KeystonePromotionInfoBar* promotionInfoBar = 228 KeystonePromotionInfoBar* promotionInfoBar =
230 [[[KeystonePromotionInfoBar alloc] init] autorelease]; 229 [[[KeystonePromotionInfoBar alloc] init] autorelease];
231 230
232 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; 231 [promotionInfoBar checkAndShowInfoBarForProfile:profile];
233 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698