summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 19:05:31 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 19:05:31 +0000
commit8af69c6c00a7a432710171d16b37abe77f18d51c (patch)
tree4ee0b9d30bc47eab2ee1cc4cbc1e9c16916cd426 /chrome
parentd283bc0f818820a4344d170b1e917840310a7742 (diff)
downloadchromium_src-8af69c6c00a7a432710171d16b37abe77f18d51c.zip
chromium_src-8af69c6c00a7a432710171d16b37abe77f18d51c.tar.gz
chromium_src-8af69c6c00a7a432710171d16b37abe77f18d51c.tar.bz2
Move TrimWhitespace to the base namespace.
R=viettrungluu@chromium.org, viettrungluu Review URL: https://codereview.chromium.org/183853011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254521 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_input.cc7
-rw-r--r--chrome/browser/autocomplete/autocomplete_match.cc2
-rw-r--r--chrome/browser/autocomplete/keyword_provider.cc2
-rw-r--r--chrome/browser/chromeos/options/vpn_config_view.cc2
-rw-r--r--chrome/browser/chromeos/options/wifi_config_view.cc2
-rw-r--r--chrome/browser/chromeos/system/syslogs_provider.cc4
-rw-r--r--chrome/browser/devtools/adb_client_socket.cc2
-rw-r--r--chrome/browser/download/download_browsertest.cc4
-rw-r--r--chrome/browser/extensions/user_script_master.cc2
-rw-r--r--chrome/browser/file_select_helper.cc3
-rw-r--r--chrome/browser/google/google_url_tracker.cc2
-rw-r--r--chrome/browser/google/google_util_chromeos.cc2
-rw-r--r--chrome/browser/history/in_memory_url_index_types.cc4
-rw-r--r--chrome/browser/net/firefox_proxy_settings.cc4
-rw-r--r--chrome/browser/profiles/profile_shortcut_manager_win.cc4
-rw-r--r--chrome/browser/renderer_context_menu/render_view_context_menu.cc3
-rw-r--r--chrome/browser/search_engines/template_url_service.cc2
-rw-r--r--chrome/browser/spellchecker/spellcheck_custom_dictionary.cc4
-rw-r--r--chrome/browser/ui/app_list/search/search_controller.cc2
-rw-r--r--chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc2
-rw-r--r--chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm2
-rw-r--r--chrome/browser/ui/omnibox/omnibox_edit_model.cc3
-rw-r--r--chrome/browser/ui/omnibox/omnibox_view.cc6
-rw-r--r--chrome/browser/ui/search_engines/edit_search_engine_controller.cc6
-rw-r--r--chrome/browser/ui/views/download/download_item_view.cc2
-rw-r--r--chrome/common/extensions/permissions/media_galleries_permission_data.cc2
-rw-r--r--chrome/common/importer/firefox_importer_utils.cc2
-rw-r--r--chrome/common/net/url_fixer_upper.cc17
-rw-r--r--chrome/installer/util/install_util.cc2
-rw-r--r--chrome/test/chromedriver/net/adb_client_socket.cc2
-rw-r--r--chrome/tools/convert_dict/hunspell_reader.cc2
31 files changed, 56 insertions, 49 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc
index fe0b1d6..48670e7 100644
--- a/chrome/browser/autocomplete/autocomplete_input.cc
+++ b/chrome/browser/autocomplete/autocomplete_input.cc
@@ -61,7 +61,8 @@ AutocompleteInput::AutocompleteInput(
<< "Text: '" << text << "', cp: " << cursor_position;
// None of the providers care about leading white space so we always trim it.
// Providers that care about trailing white space handle trimming themselves.
- if ((TrimWhitespace(text, TRIM_LEADING, &text_) & TRIM_LEADING) != 0)
+ if ((base::TrimWhitespace(text, base::TRIM_LEADING, &text_) &
+ base::TRIM_LEADING) != 0)
AdjustCursorPositionIfNecessary(text.length() - text_.length(),
&cursor_position_);
@@ -83,8 +84,8 @@ AutocompleteInput::AutocompleteInput(
if (chars_removed) {
// Remove spaces between opening question mark and first actual character.
base::string16 trimmed_text;
- if ((TrimWhitespace(text_, TRIM_LEADING, &trimmed_text) & TRIM_LEADING) !=
- 0) {
+ if ((base::TrimWhitespace(text_, base::TRIM_LEADING, &trimmed_text) &
+ base::TRIM_LEADING) != 0) {
AdjustCursorPositionIfNecessary(text_.length() - trimmed_text.length(),
&cursor_position_);
text_ = trimmed_text;
diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc
index c66f458..9450c3d 100644
--- a/chrome/browser/autocomplete/autocomplete_match.cc
+++ b/chrome/browser/autocomplete/autocomplete_match.cc
@@ -330,7 +330,7 @@ base::string16 AutocompleteMatch::SanitizeString(const base::string16& text) {
// NOTE: This logic is mirrored by |sanitizeString()| in
// omnibox_custom_bindings.js.
base::string16 result;
- TrimWhitespace(text, TRIM_LEADING, &result);
+ base::TrimWhitespace(text, base::TRIM_LEADING, &result);
base::RemoveChars(result, kInvalidChars, &result);
return result;
}
diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc
index f92f7d7..2878ed7 100644
--- a/chrome/browser/autocomplete/keyword_provider.cc
+++ b/chrome/browser/autocomplete/keyword_provider.cc
@@ -129,7 +129,7 @@ base::string16 KeywordProvider::SplitReplacementStringFromInput(
bool trim_leading_whitespace) {
// The input may contain leading whitespace, strip it.
base::string16 trimmed_input;
- TrimWhitespace(input, TRIM_LEADING, &trimmed_input);
+ base::TrimWhitespace(input, base::TRIM_LEADING, &trimmed_input);
// And extract the replacement string.
base::string16 remaining_input;
diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc
index 6c92344..4c58a80 100644
--- a/chrome/browser/chromeos/options/vpn_config_view.cc
+++ b/chrome/browser/chromeos/options/vpn_config_view.cc
@@ -1029,7 +1029,7 @@ const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield,
if (!trim_whitespace)
return untrimmed;
std::string result;
- TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result);
+ base::TrimWhitespaceASCII(untrimmed, base::TRIM_ALL, &result);
return result;
}
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index 05958f6..7272cc4 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -736,7 +736,7 @@ std::string WifiConfigView::GetSsid() const {
std::string result;
if (ssid_textfield_ != NULL) {
std::string untrimmed = base::UTF16ToUTF8(ssid_textfield_->text());
- TrimWhitespaceASCII(untrimmed, TRIM_ALL, &result);
+ base::TrimWhitespaceASCII(untrimmed, base::TRIM_ALL, &result);
}
return result;
}
diff --git a/chrome/browser/chromeos/system/syslogs_provider.cc b/chrome/browser/chromeos/system/syslogs_provider.cc
index f8fd4b0..b30212b 100644
--- a/chrome/browser/chromeos/system/syslogs_provider.cc
+++ b/chrome/browser/chromeos/system/syslogs_provider.cc
@@ -155,11 +155,11 @@ LogDictionaryType* GetSystemLogs(base::FilePath* zip_file_name,
LogDictionaryType* logs = new LogDictionaryType();
while (data.length() > 0) {
std::string key = ReadKey(&data);
- TrimWhitespaceASCII(key, TRIM_ALL, &key);
+ base::TrimWhitespaceASCII(key, base::TRIM_ALL, &key);
if (!key.empty()) {
std::string value = ReadValue(&data);
if (IsStringUTF8(value)) {
- TrimWhitespaceASCII(value, TRIM_ALL, &value);
+ base::TrimWhitespaceASCII(value, base::TRIM_ALL, &value);
if (value.empty())
(*logs)[key] = kEmptyLogEntry;
else
diff --git a/chrome/browser/devtools/adb_client_socket.cc b/chrome/browser/devtools/adb_client_socket.cc
index e16273e..47af74c 100644
--- a/chrome/browser/devtools/adb_client_socket.cc
+++ b/chrome/browser/devtools/adb_client_socket.cc
@@ -164,7 +164,7 @@ class HttpOverAdbSocket {
if (endline_pos != std::string::npos) {
std::string len = response_.substr(content_pos + 15,
endline_pos - content_pos - 15);
- TrimWhitespace(len, TRIM_ALL, &len);
+ base::TrimWhitespace(len, base::TRIM_ALL, &len);
if (!base::StringToInt(len, &expected_length)) {
CheckNetResultOrDie(net::ERR_FAILED);
return;
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index f9fe43d..f20281d 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -1950,11 +1950,11 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_DownloadTest_History) {
EXPECT_EQ(download_url, item->GetURL());
// The following are set by download-test1.lib.mock-http-headers.
std::string etag = item->GetETag();
- TrimWhitespaceASCII(etag, TRIM_ALL, &etag);
+ base::TrimWhitespaceASCII(etag, base::TRIM_ALL, &etag);
EXPECT_EQ("abracadabra", etag);
std::string last_modified = item->GetLastModifiedTime();
- TrimWhitespaceASCII(last_modified, TRIM_ALL, &last_modified);
+ base::TrimWhitespaceASCII(last_modified, base::TRIM_ALL, &last_modified);
EXPECT_EQ("Mon, 13 Nov 2006 20:31:09 GMT", last_modified);
}
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index b0c2198..9648bc3 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -51,7 +51,7 @@ static bool GetDeclarationValue(const base::StringPiece& line,
if (temp.empty() || !IsWhitespace(temp[0]))
return false;
- TrimWhitespaceASCII(temp, TRIM_ALL, value);
+ base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value);
return true;
}
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index b4f78e2..1ebbe66 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -479,7 +479,8 @@ bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) {
std::string unused;
if (accept_type.length() <= 1 ||
StringToLowerASCII(accept_type) != accept_type ||
- TrimWhitespaceASCII(accept_type, TRIM_ALL, &unused) != TRIM_NONE) {
+ base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) !=
+ base::TRIM_NONE) {
return false;
}
return true;
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index d971caf..26715a2 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -136,7 +136,7 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) {
// "<scheme>://[www.]google.<TLD>/".
std::string url_str;
source->GetResponseAsString(&url_str);
- TrimWhitespace(url_str, TRIM_ALL, &url_str);
+ base::TrimWhitespace(url_str, base::TRIM_ALL, &url_str);
GURL url(url_str);
if (!url.is_valid() || (url.path().length() > 1) || url.has_query() ||
url.has_ref() ||
diff --git a/chrome/browser/google/google_util_chromeos.cc b/chrome/browser/google/google_util_chromeos.cc
index 41f1245..a7443dc 100644
--- a/chrome/browser/google/google_util_chromeos.cc
+++ b/chrome/browser/google/google_util_chromeos.cc
@@ -30,7 +30,7 @@ std::string ReadBrandFromFile() {
base::FilePath brand_file_path(kRLZBrandFilePath);
if (!base::ReadFileToString(brand_file_path, &brand))
LOG(WARNING) << "Brand code file missing: " << brand_file_path.value();
- TrimWhitespace(brand, TRIM_ALL, &brand);
+ base::TrimWhitespace(brand, base::TRIM_ALL, &brand);
return brand;
}
diff --git a/chrome/browser/history/in_memory_url_index_types.cc b/chrome/browser/history/in_memory_url_index_types.cc
index ed661fe..f219047 100644
--- a/chrome/browser/history/in_memory_url_index_types.cc
+++ b/chrome/browser/history/in_memory_url_index_types.cc
@@ -144,9 +144,9 @@ String16Vector String16VectorFromString16(
size_t initial_whitespace = 0;
if (break_on_space) {
base::string16 trimmed_word;
- TrimWhitespace(word, TRIM_LEADING, &trimmed_word);
+ base::TrimWhitespace(word, base::TRIM_LEADING, &trimmed_word);
initial_whitespace = word.length() - trimmed_word.length();
- TrimWhitespace(trimmed_word, TRIM_TRAILING, &word);
+ base::TrimWhitespace(trimmed_word, base::TRIM_TRAILING, &word);
}
if (word.empty())
continue;
diff --git a/chrome/browser/net/firefox_proxy_settings.cc b/chrome/browser/net/firefox_proxy_settings.cc
index 2ac0438..bc3b04f 100644
--- a/chrome/browser/net/firefox_proxy_settings.cc
+++ b/chrome/browser/net/firefox_proxy_settings.cc
@@ -104,7 +104,7 @@ bool ParsePrefFile(const base::FilePath& pref_file,
}
std::string value = line.substr(start_value + 1,
stop_value - start_value - 1);
- TrimWhitespace(value, TRIM_ALL, &value);
+ base::TrimWhitespace(value, base::TRIM_ALL, &value);
// Value could be a boolean.
bool is_value_true = LowerCaseEqualsASCII(value, "true");
if (is_value_true || LowerCaseEqualsASCII(value, "false")) {
@@ -298,7 +298,7 @@ bool FirefoxProxySettings::GetSettingsFromFile(const base::FilePath& pref_file,
base::StringTokenizer string_tok(proxy_bypass, ",");
while (string_tok.GetNext()) {
std::string token = string_tok.token();
- TrimWhitespaceASCII(token, TRIM_ALL, &token);
+ base::TrimWhitespaceASCII(token, base::TRIM_ALL, &token);
if (!token.empty())
settings->proxy_bypass_list_.push_back(token);
}
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index 3314cbb..1336ac6 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -596,10 +596,10 @@ base::string16 SanitizeShortcutProfileNameString(
pos = sanitized.find_first_of(kReservedCharacters, pos + 1);
}
- TrimWhitespace(sanitized, TRIM_LEADING, &sanitized);
+ base::TrimWhitespace(sanitized, base::TRIM_LEADING, &sanitized);
if (sanitized.size() > kMaxProfileShortcutFileNameLength)
sanitized.erase(kMaxProfileShortcutFileNameLength);
- TrimWhitespace(sanitized, TRIM_TRAILING, &sanitized);
+ base::TrimWhitespace(sanitized, base::TRIM_TRAILING, &sanitized);
return sanitized;
}
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 328cf17..28d08ba 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -938,7 +938,8 @@ void RenderViewContextMenu::AppendPrintItem() {
void RenderViewContextMenu::AppendSearchProvider() {
DCHECK(profile_);
- TrimWhitespace(params_.selection_text, TRIM_ALL, &params_.selection_text);
+ base::TrimWhitespace(params_.selection_text, base::TRIM_ALL,
+ &params_.selection_text);
if (params_.selection_text.empty())
return;
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index daf1e1f..bc88cbc 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -336,7 +336,7 @@ base::string16 TemplateURLService::CleanUserInputKeyword(
const base::string16& keyword) {
// Remove the scheme.
base::string16 result(base::i18n::ToLower(keyword));
- TrimWhitespace(result, TRIM_ALL, &result);
+ base::TrimWhitespace(result, base::TRIM_ALL, &result);
url_parse::Component scheme_component;
if (url_parse::ExtractScheme(base::UTF16ToUTF8(keyword).c_str(),
static_cast<int>(keyword.length()),
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
index 536c130..a34c7b6 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -68,7 +68,7 @@ ChecksumStatus LoadFile(const base::FilePath& file_path, WordList& words) {
if (checksum != base::MD5String(contents))
return INVALID_CHECKSUM;
}
- TrimWhitespaceASCII(contents, TRIM_ALL, &contents);
+ base::TrimWhitespaceASCII(contents, base::TRIM_ALL, &contents);
base::SplitString(contents, '\n', &words);
return VALID_CHECKSUM;
}
@@ -80,7 +80,7 @@ bool IsInvalidWord(const std::string& word) {
word.length() >
chrome::spellcheck_common::MAX_CUSTOM_DICTIONARY_WORD_BYTES ||
word.empty() ||
- TRIM_NONE != TrimWhitespaceASCII(word, TRIM_ALL, &tmp);
+ base::TRIM_NONE != base::TrimWhitespaceASCII(word, base::TRIM_ALL, &tmp);
}
// Loads the custom spellcheck dictionary from |path| into |custom_words|. If
diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc
index e72066f..f938246 100644
--- a/chrome/browser/ui/app_list/search/search_controller.cc
+++ b/chrome/browser/ui/app_list/search/search_controller.cc
@@ -95,7 +95,7 @@ void SearchController::Start() {
Stop();
base::string16 query;
- TrimWhitespace(search_box_->text(), TRIM_ALL, &query);
+ base::TrimWhitespace(search_box_->text(), base::TRIM_ALL, &query);
dispatching_query_ = true;
for (Providers::iterator it = providers_.begin();
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 57f6391..1ce3532 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -226,7 +226,7 @@ void GetBillingInfoFromOutputs(const FieldValueMap& output,
it != output.end(); ++it) {
const ServerFieldType type = it->first;
base::string16 trimmed;
- TrimWhitespace(it->second, TRIM_ALL, &trimmed);
+ base::TrimWhitespace(it->second, base::TRIM_ALL, &trimmed);
// Special case CVC as CreditCard just swallows it.
if (type == CREDIT_CARD_VERIFICATION_CODE) {
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 f8fb800..6282029 100644
--- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.mm
@@ -32,7 +32,7 @@ const CGFloat kHintAvailableRatio = 2.0 / 3.0;
// ends.
NSString* TrimAndConvert(const base::string16& s) {
base::string16 output;
- TrimWhitespace(s, TRIM_ALL, &output);
+ base::TrimWhitespace(s, base::TRIM_ALL, &output);
return base::SysUTF16ToNSString(output);
}
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index d5cc346..b74d449 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -1368,7 +1368,8 @@ bool OmniboxEditModel::CreatedKeywordSearchByInsertingSpaceInMiddle(
// Then check if the text before the inserted space matches a keyword.
base::string16 keyword;
- TrimWhitespace(new_text.substr(0, space_position), TRIM_LEADING, &keyword);
+ base::TrimWhitespace(new_text.substr(0, space_position), base::TRIM_LEADING,
+ &keyword);
return !keyword.empty() && !autocomplete_controller()->keyword_provider()->
GetKeywordForText(keyword).empty();
}
diff --git a/chrome/browser/ui/omnibox/omnibox_view.cc b/chrome/browser/ui/omnibox/omnibox_view.cc
index 4708d06..1a1dc2a 100644
--- a/chrome/browser/ui/omnibox/omnibox_view.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view.cc
@@ -25,8 +25,10 @@ base::string16 OmniboxView::StripJavascriptSchemas(const base::string16& text) {
const base::string16 kJsPrefix(
base::ASCIIToUTF16(content::kJavaScriptScheme) + base::ASCIIToUTF16(":"));
base::string16 out(text);
- while (StartsWith(out, kJsPrefix, false))
- TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out);
+ while (StartsWith(out, kJsPrefix, false)) {
+ base::TrimWhitespace(out.substr(kJsPrefix.length()), base::TRIM_LEADING,
+ &out);
+ }
return out;
}
diff --git a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
index e608484..acf8b0d 100644
--- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
+++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
@@ -122,9 +122,9 @@ void EditSearchEngineController::CleanUpCancelledAdd() {
std::string EditSearchEngineController::GetFixedUpURL(
const std::string& url_input) const {
std::string url;
- TrimWhitespace(TemplateURLRef::DisplayURLToURLRef(
- base::UTF8ToUTF16(url_input)),
- TRIM_ALL, &url);
+ base::TrimWhitespace(TemplateURLRef::DisplayURLToURLRef(
+ base::UTF8ToUTF16(url_input)),
+ base::TRIM_ALL, &url);
if (url.empty())
return url;
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 5bc9bfc..1f1b946 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -1231,7 +1231,7 @@ void DownloadItemView::SizeLabelToMinWidth() {
return;
base::string16 label_text = dangerous_download_label_->text();
- TrimWhitespace(label_text, TRIM_ALL, &label_text);
+ base::TrimWhitespace(label_text, base::TRIM_ALL, &label_text);
DCHECK_EQ(base::string16::npos, label_text.find('\n'));
// Make the label big so that GetPreferredSize() is not constrained by the
diff --git a/chrome/common/extensions/permissions/media_galleries_permission_data.cc b/chrome/common/extensions/permissions/media_galleries_permission_data.cc
index 9f05181..fd8a9da 100644
--- a/chrome/common/extensions/permissions/media_galleries_permission_data.cc
+++ b/chrome/common/extensions/permissions/media_galleries_permission_data.cc
@@ -36,7 +36,7 @@ bool MediaGalleriesPermissionData::FromValue(const base::Value* value) {
return false;
std::string permission;
- TrimWhitespaceASCII(raw_permission, TRIM_ALL, &permission);
+ base::TrimWhitespaceASCII(raw_permission, base::TRIM_ALL, &permission);
if (permission == MediaGalleriesPermission::kAllAutoDetectedPermission ||
permission == MediaGalleriesPermission::kScanPermission ||
diff --git a/chrome/common/importer/firefox_importer_utils.cc b/chrome/common/importer/firefox_importer_utils.cc
index b96a7a4..3cc9b87 100644
--- a/chrome/common/importer/firefox_importer_utils.cc
+++ b/chrome/common/importer/firefox_importer_utils.cc
@@ -307,7 +307,7 @@ base::string16 GetFirefoxImporterName(const base::FilePath& app_path) {
const std::string name_attr("Name=");
bool in_app_section = false;
for (size_t i = 0; i < lines.size(); ++i) {
- TrimWhitespace(lines[i], TRIM_ALL, &lines[i]);
+ base::TrimWhitespace(lines[i], base::TRIM_ALL, &lines[i]);
if (lines[i] == "[App]") {
in_app_section = true;
} else if (in_app_section) {
diff --git a/chrome/common/net/url_fixer_upper.cc b/chrome/common/net/url_fixer_upper.cc
index 13c923b..96d7f4e 100644
--- a/chrome/common/net/url_fixer_upper.cc
+++ b/chrome/common/net/url_fixer_upper.cc
@@ -74,16 +74,17 @@ void UTF8PartsToUTF16Parts(const std::string& text_utf8,
UTF8ComponentToUTF16Component(text_utf8, parts_utf8.ref);
}
-TrimPositions TrimWhitespaceUTF8(const std::string& input,
- TrimPositions positions,
- std::string* output) {
+base::TrimPositions TrimWhitespaceUTF8(const std::string& input,
+ base::TrimPositions positions,
+ std::string* output) {
// This implementation is not so fast since it converts the text encoding
// twice. Please feel free to file a bug if this function hurts the
// performance of Chrome.
DCHECK(IsStringUTF8(input));
base::string16 input16 = base::UTF8ToUTF16(input);
base::string16 output16;
- TrimPositions result = TrimWhitespace(input16, positions, &output16);
+ base::TrimPositions result =
+ base::TrimWhitespace(input16, positions, &output16);
*output = base::UTF16ToUTF8(output16);
return result;
}
@@ -92,10 +93,10 @@ TrimPositions TrimWhitespaceUTF8(const std::string& input,
void PrepareStringForFileOps(const base::FilePath& text,
base::FilePath::StringType* output) {
#if defined(OS_WIN)
- TrimWhitespace(text.value(), TRIM_ALL, output);
+ base::TrimWhitespace(text.value(), base::TRIM_ALL, output);
replace(output->begin(), output->end(), '/', '\\');
#else
- TrimWhitespaceUTF8(text.value(), TRIM_ALL, output);
+ TrimWhitespaceUTF8(text.value(), base::TRIM_ALL, output);
#endif
}
@@ -389,7 +390,7 @@ std::string SegmentURLInternal(std::string* text, url_parse::Parsed* parts) {
*parts = url_parse::Parsed();
std::string trimmed;
- TrimWhitespaceUTF8(*text, TRIM_ALL, &trimmed);
+ TrimWhitespaceUTF8(*text, base::TRIM_ALL, &trimmed);
if (trimmed.empty())
return std::string(); // Nothing to segment.
@@ -501,7 +502,7 @@ base::string16 URLFixerUpper::SegmentURL(const base::string16& text,
GURL URLFixerUpper::FixupURL(const std::string& text,
const std::string& desired_tld) {
std::string trimmed;
- TrimWhitespaceUTF8(text, TRIM_ALL, &trimmed);
+ TrimWhitespaceUTF8(text, base::TRIM_ALL, &trimmed);
if (trimmed.empty())
return GURL(); // Nothing here.
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index e803834..8ff309c 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -173,7 +173,7 @@ bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) {
params = params.substr(program.length());
}
- TrimWhitespace(params, TRIM_ALL, &params);
+ base::TrimWhitespace(params, base::TRIM_ALL, &params);
HWND uac_foreground_window = CreateUACForegroundWindow();
diff --git a/chrome/test/chromedriver/net/adb_client_socket.cc b/chrome/test/chromedriver/net/adb_client_socket.cc
index 3e68a21..76e2a07 100644
--- a/chrome/test/chromedriver/net/adb_client_socket.cc
+++ b/chrome/test/chromedriver/net/adb_client_socket.cc
@@ -184,7 +184,7 @@ class HttpOverAdbSocket {
if (endline_pos != std::string::npos) {
std::string len = response_.substr(content_pos + 15,
endline_pos - content_pos - 15);
- TrimWhitespace(len, TRIM_ALL, &len);
+ base::TrimWhitespace(len, base::TRIM_ALL, &len);
if (!base::StringToInt(len, &expected_length)) {
CheckNetResultOrDie(net::ERR_FAILED);
return;
diff --git a/chrome/tools/convert_dict/hunspell_reader.cc b/chrome/tools/convert_dict/hunspell_reader.cc
index f6ddc79..6555fb7 100644
--- a/chrome/tools/convert_dict/hunspell_reader.cc
+++ b/chrome/tools/convert_dict/hunspell_reader.cc
@@ -23,7 +23,7 @@ void TrimLine(std::string* line) {
// Treat this text as an ASCII text and trim whitespace characters as
// hunspell does. The returned text is to be converted into UTF-8 text with
// the encoding defined in an affix file.
- TrimWhitespace(*line, TRIM_ALL, line);
+ base::TrimWhitespace(*line, base::TRIM_ALL, line);
}
std::string ReadLine(FILE* file) {