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

Side by Side Diff: chrome/browser/cocoa/keystone_infobar.mm

Issue 3127009: Convert infobar APIs to UTF-16. (Closed)
Patch Set: works Created 10 years, 4 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/keystone_infobar.h" 5 #include "chrome/browser/cocoa/keystone_infobar.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const NavigationController::LoadCommittedDetails& details) { 55 const NavigationController::LoadCommittedDetails& details) {
56 return can_expire_; 56 return can_expire_;
57 } 57 }
58 58
59 virtual void InfoBarClosed() { 59 virtual void InfoBarClosed() {
60 delete this; 60 delete this;
61 } 61 }
62 62
63 // Inherited from AlertInfoBarDelegate and overridden. 63 // Inherited from AlertInfoBarDelegate and overridden.
64 64
65 virtual std::wstring GetMessageText() const { 65 virtual string16 GetMessageText() const {
66 return l10n_util::GetStringF(IDS_PROMOTE_INFOBAR_TEXT, 66 return l10n_util::GetStringFUTF16(IDS_PROMOTE_INFOBAR_TEXT,
67 l10n_util::GetString(IDS_PRODUCT_NAME)); 67 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
68 } 68 }
69 69
70 virtual SkBitmap* GetIcon() const { 70 virtual SkBitmap* GetIcon() const {
71 return ResourceBundle::GetSharedInstance().GetBitmapNamed( 71 return ResourceBundle::GetSharedInstance().GetBitmapNamed(
72 IDR_PRODUCT_ICON_32); 72 IDR_PRODUCT_ICON_32);
73 } 73 }
74 74
75 // Inherited from ConfirmInfoBarDelegate and overridden. 75 // Inherited from ConfirmInfoBarDelegate and overridden.
76 76
77 virtual int GetButtons() const { 77 virtual int GetButtons() const {
78 return BUTTON_OK | BUTTON_CANCEL | BUTTON_OK_DEFAULT; 78 return BUTTON_OK | BUTTON_CANCEL | BUTTON_OK_DEFAULT;
79 } 79 }
80 80
81 virtual std::wstring GetButtonLabel(InfoBarButton button) const { 81 virtual string16 GetButtonLabel(InfoBarButton button) const {
82 return button == BUTTON_OK ? 82 return button == BUTTON_OK ?
83 l10n_util::GetString(IDS_PROMOTE_INFOBAR_PROMOTE_BUTTON) : 83 l10n_util::GetStringUTF16(IDS_PROMOTE_INFOBAR_PROMOTE_BUTTON) :
84 l10n_util::GetString(IDS_PROMOTE_INFOBAR_DONT_ASK_BUTTON); 84 l10n_util::GetStringUTF16(IDS_PROMOTE_INFOBAR_DONT_ASK_BUTTON);
85 } 85 }
86 86
87 virtual bool Accept() { 87 virtual bool Accept() {
88 [[KeystoneGlue defaultKeystoneGlue] promoteTicket]; 88 [[KeystoneGlue defaultKeystoneGlue] promoteTicket];
89 return true; 89 return true;
90 } 90 }
91 91
92 virtual bool Cancel() { 92 virtual bool Cancel() {
93 profile_->GetPrefs()->SetBoolean(prefs::kShowUpdatePromotionInfoBar, false); 93 profile_->GetPrefs()->SetBoolean(prefs::kShowUpdatePromotionInfoBar, false);
94 return true; 94 return true;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 @end // @implementation KeystonePromotionInfoBar 204 @end // @implementation KeystonePromotionInfoBar
205 205
206 // static 206 // static
207 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { 207 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) {
208 KeystonePromotionInfoBar* promotionInfoBar = 208 KeystonePromotionInfoBar* promotionInfoBar =
209 [[[KeystonePromotionInfoBar alloc] init] autorelease]; 209 [[[KeystonePromotionInfoBar alloc] init] autorelease];
210 210
211 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; 211 [promotionInfoBar checkAndShowInfoBarForProfile:profile];
212 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698