summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 19:47:20 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 19:47:20 +0000
commite5a8c47bda7fe8e3d8491fdd74cd166da02b8a7b (patch)
tree35f5b482eb88291018ecc7a9236d6a9067329fe5
parent13ecb04b3a06a7e84c95a6b7c99f64529aa03b61 (diff)
downloadchromium_src-e5a8c47bda7fe8e3d8491fdd74cd166da02b8a7b.zip
chromium_src-e5a8c47bda7fe8e3d8491fdd74cd166da02b8a7b.tar.gz
chromium_src-e5a8c47bda7fe8e3d8491fdd74cd166da02b8a7b.tar.bz2
Remove a deprecated wstring ToLower function.
BUG=23581 Review URL: http://codereview.chromium.org/3044043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54946 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/l10n_util.cc6
-rw-r--r--app/l10n_util.h4
-rw-r--r--chrome/browser/autocomplete/search_provider.cc2
-rw-r--r--chrome/browser/search_engines/template_url.cc2
-rw-r--r--chrome/browser/search_engines/template_url_model.cc2
-rw-r--r--chrome/browser/spellcheck_host.cc5
-rw-r--r--views/controls/menu/menu_controller.cc6
-rw-r--r--views/controls/menu/menu_item_view.cc3
8 files changed, 12 insertions, 18 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index 7b8ceb3..1ec4b19 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -718,12 +718,6 @@ std::wstring TruncateString(const std::wstring& string, size_t length) {
return string.substr(0, index) + kElideString;
}
-#if defined(WCHAR_T_IS_UTF32)
-std::wstring ToLower(const std::wstring& string) {
- return UTF16ToWide(ToLower(WideToUTF16(string)));
-}
-#endif // defined(WCHAR_T_IS_UTF32)
-
string16 ToLower(const string16& string) {
icu::UnicodeString lower_u_str(
icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault()));
diff --git a/app/l10n_util.h b/app/l10n_util.h
index 62789a9..4bc3ba8 100644
--- a/app/l10n_util.h
+++ b/app/l10n_util.h
@@ -169,10 +169,6 @@ std::wstring GetStringF(int message_id, int64 a);
std::wstring TruncateString(const std::wstring& string, size_t length);
// Returns the lower case equivalent of string.
-#if defined(WCHAR_T_IS_UTF32)
-// Deprecated. The string16 version should be used instead.
-std::wstring ToLower(const std::wstring& string);
-#endif // defined(WCHAR_T_IS_UTF32)
string16 ToLower(const string16& string);
// Returns the upper case equivalent of string.
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 08dc01c..77359c7 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -716,7 +716,7 @@ void SearchProvider::AddMatchToMap(const std::wstring& query_string,
// NOTE: Keep this ToLower() call in sync with url_database.cc.
const std::pair<MatchMap::iterator, bool> i = map->insert(
std::pair<std::wstring, AutocompleteMatch>(
- l10n_util::ToLower(query_string), match));
+ UTF16ToWide(l10n_util::ToLower(WideToUTF16(query_string))), match));
// NOTE: We purposefully do a direct relevance comparison here instead of
// using AutocompleteMatch::MoreRelevant(), so that we'll prefer "items added
// first" rather than "items alphabetically first" when the scores are equal.
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index 3bdd459..8817267 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -561,7 +561,7 @@ void TemplateURL::SetURL(const std::string& url,
void TemplateURL::set_keyword(const std::wstring& keyword) {
// Case sensitive keyword matching is confusing. As such, we force all
// keywords to be lower case.
- keyword_ = l10n_util::ToLower(keyword);
+ keyword_ = UTF16ToWide(l10n_util::ToLower(WideToUTF16(keyword)));
autogenerate_keyword_ = false;
}
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index ba8e38c..12c5726 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -161,7 +161,7 @@ std::wstring TemplateURLModel::GenerateKeyword(const GURL& url,
std::wstring TemplateURLModel::CleanUserInputKeyword(
const std::wstring& keyword) {
// Remove the scheme.
- std::wstring result(l10n_util::ToLower(keyword));
+ std::wstring result(UTF16ToWide(l10n_util::ToLower(WideToUTF16(keyword))));
url_parse::Component scheme_component;
if (url_parse::ExtractScheme(WideToUTF8(keyword).c_str(),
static_cast<int>(keyword.length()),
diff --git a/chrome/browser/spellcheck_host.cc b/chrome/browser/spellcheck_host.cc
index 7ac1a3f..642c29f 100644
--- a/chrome/browser/spellcheck_host.cc
+++ b/chrome/browser/spellcheck_host.cc
@@ -220,8 +220,9 @@ void SpellCheckHost::DownloadDictionary() {
// Determine URL of file to download.
static const char kDownloadServerUrl[] =
"http://cache.pack.google.com/edgedl/chrome/dict/";
- GURL url = GURL(std::string(kDownloadServerUrl) + WideToUTF8(
- l10n_util::ToLower(bdict_file_path_.BaseName().ToWStringHack())));
+ GURL url = GURL(std::string(kDownloadServerUrl) +
+ StringToLowerASCII(WideToUTF8(
+ bdict_file_path_.BaseName().ToWStringHack())));
fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this));
fetcher_->set_request_context(request_context_getter_);
tried_to_download_ = true;
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index 21a7708..3d49366 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -9,6 +9,7 @@
#include "base/i18n/rtl.h"
#include "base/keyboard_codes.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "gfx/canvas_skia.h"
#include "views/controls/button/menu_button.h"
#include "views/controls/menu/menu_scroll_view_container.h"
@@ -1537,7 +1538,7 @@ void MenuController::CloseSubmenu() {
bool MenuController::SelectByChar(wchar_t character) {
wchar_t char_array[1] = { character };
- wchar_t key = l10n_util::ToLower(char_array)[0];
+ wchar_t key = UTF16ToWide(l10n_util::ToLower(WideToUTF16(char_array)))[0];
MenuItemView* item = pending_state_.item;
if (!item->HasSubmenu() || !item->GetSubmenu()->IsShowing())
item = item->GetParentMenuItem();
@@ -1570,7 +1571,8 @@ bool MenuController::SelectByChar(wchar_t character) {
for (int i = 0; i < menu_item_count; ++i) {
MenuItemView* child = submenu->GetMenuItemAt(i);
if (!child->GetMnemonic() && child->IsEnabled()) {
- std::wstring lower_title = l10n_util::ToLower(child->GetTitle());
+ std::wstring lower_title = UTF16ToWide(
+ l10n_util::ToLower(WideToUTF16(child->GetTitle())));
if (child == pending_state_.item)
index_of_item = i;
if (lower_title.length() && lower_title[0] == key) {
diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc
index b88fc5b..e0ca73d 100644
--- a/views/controls/menu/menu_item_view.cc
+++ b/views/controls/menu/menu_item_view.cc
@@ -5,6 +5,7 @@
#include "views/controls/menu/menu_item_view.h"
#include "app/l10n_util.h"
+#include "base/utf_string_conversions.h"
#include "gfx/canvas.h"
#include "grit/app_strings.h"
#include "views/controls/button/text_button.h"
@@ -316,7 +317,7 @@ wchar_t MenuItemView::GetMnemonic() {
if (index != std::wstring::npos) {
if (index + 1 != title.size() && title[index + 1] != '&') {
wchar_t char_array[1] = { title[index + 1] };
- return l10n_util::ToLower(char_array)[0];
+ return UTF16ToWide(l10n_util::ToLower(WideToUTF16(char_array)))[0];
}
index++;
}