summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-28 23:29:42 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-28 23:29:42 +0000
commit42197a2a59f7d74ab299dce1be5c7831c3bf49b0 (patch)
treebbeac88b36d834a55f0f01eb85326dc012e0f1fa /chrome/browser/ui
parentf61ba8cfb9b5ef812c131de7860433cd832a60ff (diff)
downloadchromium_src-42197a2a59f7d74ab299dce1be5c7831c3bf49b0.zip
chromium_src-42197a2a59f7d74ab299dce1be5c7831c3bf49b0.tar.gz
chromium_src-42197a2a59f7d74ab299dce1be5c7831c3bf49b0.tar.bz2
Remove wstring from l10n_util. Part 2.
BUG=9911 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/5959008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/browser.cc8
-rw-r--r--chrome/browser/ui/cocoa/download/download_item_cell.mm4
-rw-r--r--chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm3
-rw-r--r--chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h3
-rw-r--r--chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm16
-rw-r--r--chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration_unittest.mm3
-rw-r--r--chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm3
-rw-r--r--chrome/browser/ui/views/download_item_view.cc4
8 files changed, 23 insertions, 21 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d2d831e..52a3b96 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2664,8 +2664,7 @@ void Browser::TabSelectedAt(TabContentsWrapper* old_contents,
status_bubble->Hide();
// Show the loading state (if any).
- status_bubble->SetStatus(WideToUTF16Hack(
- GetSelectedTabContents()->GetStatusText()));
+ status_bubble->SetStatus(GetSelectedTabContents()->GetStatusText());
}
if (HasFindBarController()) {
@@ -2831,8 +2830,7 @@ void Browser::LoadingStateChanged(TabContents* source) {
if (source == selected_contents) {
UpdateReloadStopState(source->is_loading(), false);
if (GetStatusBubble()) {
- GetStatusBubble()->SetStatus(WideToUTF16(
- GetSelectedTabContents()->GetStatusText()));
+ GetStatusBubble()->SetStatus(GetSelectedTabContents()->GetStatusText());
}
if (!source->is_loading() &&
@@ -3787,7 +3785,7 @@ void Browser::ProcessPendingUIUpdates() {
// Updating the URL happens synchronously in ScheduleUIUpdate.
if (flags & TabContents::INVALIDATE_LOAD && GetStatusBubble())
- GetStatusBubble()->SetStatus(WideToUTF16(contents->GetStatusText()));
+ GetStatusBubble()->SetStatus(contents->GetStatusText());
if (flags & (TabContents::INVALIDATE_TAB |
TabContents::INVALIDATE_TITLE)) {
diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm
index b83d6f5..d2a8335 100644
--- a/chrome/browser/ui/cocoa/download/download_item_cell.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm
@@ -237,14 +237,14 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
// Set the name of the download.
downloadPath_ = downloadModel->download()->GetFileNameToReportUser();
- std::wstring statusText = downloadModel->GetStatusText();
+ string16 statusText = downloadModel->GetStatusText();
if (statusText.empty()) {
// Remove the status text label.
[self hideSecondaryTitle];
isStatusTextVisible_ = NO;
} else {
// Set status text.
- NSString* statusString = base::SysWideToNSString(statusText);
+ NSString* statusString = base::SysUTF16ToNSString(statusText);
[self setSecondaryTitle:statusString];
isStatusTextVisible_ = YES;
}
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
index 1598cad..845835a 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
@@ -6,6 +6,7 @@
#include "app/resource_bundle.h"
#include "base/scoped_nsobject.h"
+#include "base/utf_string_conversions.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
#import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h"
@@ -133,7 +134,7 @@ TEST_F(AutocompleteTextFieldCellTest, DISABLED_FocusedDisplay) {
KeywordHintDecoration keyword_hint_decoration([view_ font]);
keyword_hint_decoration.SetVisible(true);
- keyword_hint_decoration.SetKeyword(std::wstring(L"google"), false);
+ keyword_hint_decoration.SetKeyword(ASCIIToUTF16("google"), false);
[cell addRightDecoration:&keyword_hint_decoration];
EXPECT_NE(keyword_hint_decoration.GetWidthForSpace(kVeryWide),
LocationBarDecoration::kOmittedWidth);
diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h
index 3b8c607..da8c42b 100644
--- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h
@@ -11,6 +11,7 @@
#import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
#import "base/scoped_nsobject.h"
+#include "base/string16.h"
// Draws the keyword hint, "Press [tab] to search <site>".
@@ -21,7 +22,7 @@ class KeywordHintDecoration : public LocationBarDecoration {
// Calculates the message to display and where to place the [tab]
// image.
- void SetKeyword(const std::wstring& keyword, bool is_extension_keyword);
+ void SetKeyword(const string16& keyword, bool is_extension_keyword);
// Implement |LocationBarDecoration|.
virtual void DrawInFrame(NSRect frame, NSView* control_view);
diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm
index 0b080319..767092b 100644
--- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm
@@ -34,10 +34,10 @@ const CGFloat kHintAvailableRatio = 2.0 / 3.0;
// Helper to convert |s| to an |NSString|, trimming whitespace at
// ends.
-NSString* TrimAndConvert(const std::wstring& s) {
- std::wstring output;
+NSString* TrimAndConvert(const string16& s) {
+ string16 output;
TrimWhitespace(s, TRIM_ALL, &output);
- return base::SysWideToNSString(output);
+ return base::SysUTF16ToNSString(output);
}
} // namespace
@@ -65,7 +65,7 @@ NSImage* KeywordHintDecoration::GetHintImage() {
return hint_image_;
}
-void KeywordHintDecoration::SetKeyword(const std::wstring& short_name,
+void KeywordHintDecoration::SetKeyword(const string16& short_name,
bool is_extension_keyword) {
// KEYWORD_HINT is a message like "Press [tab] to search <site>".
// [tab] is a parameter to be replaced by an image. "<site>" is
@@ -73,10 +73,10 @@ void KeywordHintDecoration::SetKeyword(const std::wstring& short_name,
std::vector<size_t> content_param_offsets;
int message_id = is_extension_keyword ?
IDS_OMNIBOX_EXTENSION_KEYWORD_HINT : IDS_OMNIBOX_KEYWORD_HINT;
- const std::wstring keyword_hint(
- l10n_util::GetStringF(message_id,
- std::wstring(), short_name,
- &content_param_offsets));
+ const string16 keyword_hint(
+ l10n_util::GetStringFUTF16(message_id,
+ string16(), short_name,
+ &content_param_offsets));
// Should always be 2 offsets, see the comment in
// location_bar_view.cc after IDS_OMNIBOX_KEYWORD_HINT fetch.
diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration_unittest.mm
index bfcf454..12ac5d8 100644
--- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration_unittest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration_unittest.mm
@@ -6,6 +6,7 @@
#import "chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h"
+#include "base/utf_string_conversions.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -22,7 +23,7 @@ class KeywordHintDecorationTest : public CocoaTest {
TEST_F(KeywordHintDecorationTest, GetWidthForSpace) {
decoration_.SetVisible(true);
- decoration_.SetKeyword(std::wstring(L"Google"), false);
+ decoration_.SetKeyword(ASCIIToUTF16("google"), false);
const CGFloat kVeryWide = 1000.0;
const CGFloat kFairlyWide = 100.0; // Estimate for full hint space.
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index d433822..32002e6 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -680,7 +680,8 @@ void LocationBarViewMac::Layout() {
std::wstring label(toolbar_model_->GetEVCertName());
ev_bubble_decoration_->SetFullLabel(base::SysWideToNSString(label));
} else if (!keyword.empty() && is_keyword_hint) {
- keyword_hint_decoration_->SetKeyword(short_name, is_extension_keyword);
+ keyword_hint_decoration_->SetKeyword(WideToUTF16Hack(short_name),
+ is_extension_keyword);
keyword_hint_decoration_->SetVisible(true);
}
diff --git a/chrome/browser/ui/views/download_item_view.cc b/chrome/browser/ui/views/download_item_view.cc
index f6d022d..3ebdf44 100644
--- a/chrome/browser/ui/views/download_item_view.cc
+++ b/chrome/browser/ui/views/download_item_view.cc
@@ -353,7 +353,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) {
ClearDangerousMode();
}
- std::wstring status_text = model_->GetStatusText();
+ string16 status_text = model_->GetStatusText();
switch (download_->state()) {
case DownloadItem::IN_PROGRESS:
download_->is_paused() ? StopDownloadProgress() : StartDownloadProgress();
@@ -384,7 +384,7 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) {
NOTREACHED();
}
- status_text_ = status_text;
+ status_text_ = UTF16ToWideHack(status_text);
UpdateAccessibleName();
// We use the parent's (DownloadShelfView's) SchedulePaint, since there