summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-18 17:35:12 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-18 17:35:12 +0000
commit22b28c134e75d3f48479a42531f07776fd466d0f (patch)
tree84376af62d5b8ec1ba457b927658034e767ec6b7 /app
parentb1357f5d438d1ee75973684e0bbd9445907c19aa (diff)
downloadchromium_src-22b28c134e75d3f48479a42531f07776fd466d0f.zip
chromium_src-22b28c134e75d3f48479a42531f07776fd466d0f.tar.gz
chromium_src-22b28c134e75d3f48479a42531f07776fd466d0f.tar.bz2
Some wstring -> string16 conversion in src/app.
It looks like l10n_util_dummy.cc isn't needed anymore: The function in the file doesn't match any functions in l10n_util.h. Convert BidiLineIterator to use string16. I don't see any unittests for this file. :( BUG=23581 TEST=None Review URL: http://codereview.chromium.org/6315002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/app_base.gypi1
-rw-r--r--app/bidi_line_iterator.cc9
-rw-r--r--app/bidi_line_iterator.h3
-rw-r--r--app/l10n_util_dummy.cc22
-rw-r--r--app/resource_bundle_dummy.cc2
-rw-r--r--app/resource_bundle_win.cc2
6 files changed, 6 insertions, 33 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi
index 126d04d..af50e10 100644
--- a/app/app_base.gypi
+++ b/app/app_base.gypi
@@ -441,7 +441,6 @@
],
},
'sources': [
- 'l10n_util_dummy.cc',
'resource_bundle_dummy.cc',
],
'include_dirs': [
diff --git a/app/bidi_line_iterator.cc b/app/bidi_line_iterator.cc
index 2002c0d..3312ef0 100644
--- a/app/bidi_line_iterator.cc
+++ b/app/bidi_line_iterator.cc
@@ -15,7 +15,7 @@ BiDiLineIterator::~BiDiLineIterator() {
}
}
-UBool BiDiLineIterator::Open(const std::wstring& text,
+UBool BiDiLineIterator::Open(const string16& text,
bool right_to_left,
bool url) {
DCHECK(bidi_ == NULL);
@@ -25,12 +25,7 @@ UBool BiDiLineIterator::Open(const std::wstring& text,
return false;
if (right_to_left && url)
ubidi_setReorderingMode(bidi_, UBIDI_REORDER_RUNS_ONLY);
-#if defined(WCHAR_T_IS_UTF32)
- const string16 text_utf16 = WideToUTF16(text);
-#else
- const std::wstring &text_utf16 = text;
-#endif // U_SIZEOF_WCHAR_T != 4
- ubidi_setPara(bidi_, text_utf16.data(), static_cast<int>(text_utf16.length()),
+ ubidi_setPara(bidi_, text.data(), static_cast<int>(text.length()),
right_to_left ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR,
NULL, &error);
return U_SUCCESS(error);
diff --git a/app/bidi_line_iterator.h b/app/bidi_line_iterator.h
index 178d775..a4faa2f 100644
--- a/app/bidi_line_iterator.h
+++ b/app/bidi_line_iterator.h
@@ -11,6 +11,7 @@
#include "unicode/ubidi.h"
#include "base/basictypes.h"
+#include "base/string16.h"
// A simple wrapper class for the bidirectional iterator of ICU.
// This class uses the bidirectional iterator of ICU to split a line of
@@ -22,7 +23,7 @@ class BiDiLineIterator {
// Initializes the bidirectional iterator with the specified text. Returns
// whether initialization succeeded.
- UBool Open(const std::wstring& text, bool right_to_left, bool url);
+ UBool Open(const string16& text, bool right_to_left, bool url);
// Returns the number of visual runs in the text, or zero on error.
int CountRuns();
diff --git a/app/l10n_util_dummy.cc b/app/l10n_util_dummy.cc
deleted file mode 100644
index 4c9b23b..0000000
--- a/app/l10n_util_dummy.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "app/resource_bundle.h"
-#include "base/command_line.h"
-#include "base/string16.h"
-#include "base/string_piece.h"
-#include "base/sys_string_conversions.h"
-#include "base/utf_string_conversions.h"
-#include "build/build_config.h"
-#include "unicode/uscript.h"
-
-
-namespace l10n_util {
-
-std::wstring GetString(int message_id) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- return UTF16ToWide(rb.GetLocalizedString(message_id));
-}
-
-} // namespace l10n_util
diff --git a/app/resource_bundle_dummy.cc b/app/resource_bundle_dummy.cc
index e93df01..510b8fd 100644
--- a/app/resource_bundle_dummy.cc
+++ b/app/resource_bundle_dummy.cc
@@ -60,5 +60,5 @@ ResourceBundle::~ResourceBundle() {
string16 ResourceBundle::GetLocalizedString(int message_id) {
- return std::wstring();
+ return string16();
}
diff --git a/app/resource_bundle_win.cc b/app/resource_bundle_win.cc
index 89a68e1..616faac 100644
--- a/app/resource_bundle_win.cc
+++ b/app/resource_bundle_win.cc
@@ -159,7 +159,7 @@ string16 ResourceBundle::GetLocalizedString(int message_id) {
// See http://crbug.com/21925.
base::debug::StackTrace().PrintBacktrace();
NOTREACHED() << "unable to find resource: " << message_id;
- return std::wstring();
+ return string16();
}
}
// Copy into a string16 and return.