summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ash/shell/app_list.cc2
-rw-r--r--base/command_line.cc6
-rw-r--r--base/i18n/file_util_icu.cc2
-rw-r--r--base/linux_util.cc2
-rw-r--r--base/nix/mime_util_xdg.cc11
-rw-r--r--base/process/process_metrics_linux.cc5
-rw-r--r--base/strings/string_util.cc12
-rw-r--r--base/strings/string_util.h22
-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
-rw-r--r--chromeos/dbus/power_policy_controller.cc2
-rw-r--r--chromeos/system/name_value_pairs_parser.cc2
-rw-r--r--components/autofill/content/browser/wallet/required_action.cc3
-rw-r--r--components/autofill/content/browser/wallet/wallet_client.cc12
-rw-r--r--components/autofill/content/renderer/autofill_agent.cc6
-rw-r--r--components/autofill/content/renderer/form_autofill_util.cc14
-rw-r--r--components/autofill/core/browser/autofill_manager.cc2
-rw-r--r--components/autofill/core/browser/autofill_profile.cc2
-rw-r--r--components/autofill/core/browser/personal_data_manager.cc2
-rw-r--r--components/autofill/core/browser/validation.cc4
-rw-r--r--components/plugins/renderer/plugin_placeholder.cc4
-rw-r--r--components/translate/language_detection/language_detection_util.cc2
-rw-r--r--content/browser/web_contents/web_contents_impl.cc2
-rw-r--r--content/child/npapi/plugin_host.cc4
-rw-r--r--content/renderer/npapi/webplugin_impl_unittest.cc4
-rw-r--r--content/renderer/p2p/port_allocator.cc4
-rw-r--r--content/renderer/render_frame_impl.cc7
-rw-r--r--extensions/common/feature_switch.cc2
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow.cc4
-rw-r--r--net/base/host_mapping_rules.cc2
-rw-r--r--net/base/ip_mapping_rules.cc2
-rw-r--r--net/base/net_util.cc7
-rw-r--r--net/ftp/ftp_util.cc2
-rw-r--r--net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc2
-rw-r--r--net/proxy/proxy_bypass_rules.cc2
-rw-r--r--net/proxy/proxy_config.cc2
-rw-r--r--net/proxy/proxy_config_service_android.cc2
-rw-r--r--net/proxy/proxy_config_service_linux.cc6
-rw-r--r--net/server/http_server.cc2
-rw-r--r--net/test/python_utils_unittest.cc2
-rw-r--r--ppapi/proxy/file_chooser_resource.cc2
-rw-r--r--printing/backend/cups_helper.cc5
-rw-r--r--remoting/host/setup/daemon_controller_delegate_linux.cc4
-rw-r--r--rlz/lib/rlz_lib.cc6
-rw-r--r--third_party/leveldatabase/env_chromium_win.cc2
-rw-r--r--tools/gn/input_conversion.cc2
-rw-r--r--tools/gn/setup.cc2
-rw-r--r--ui/app_list/cocoa/app_list_view_controller.mm2
-rw-r--r--ui/app_list/views/app_list_main_view.cc2
-rw-r--r--ui/base/clipboard/clipboard_util_win.cc4
-rw-r--r--ui/gfx/font_fallback_win.cc3
-rw-r--r--ui/gfx/text_elider.cc7
-rw-r--r--ui/views/controls/styled_label.cc11
-rw-r--r--ui/views/corewm/tooltip_controller.cc3
-rw-r--r--win8/delegate_execute/delegate_execute_util.cc2
84 files changed, 176 insertions, 161 deletions
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc
index bbeda55..c3ea36b 100644
--- a/ash/shell/app_list.cc
+++ b/ash/shell/app_list.cc
@@ -287,7 +287,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
virtual void StartSearch() OVERRIDE {
base::string16 query;
- TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query);
+ base::TrimWhitespace(model_->search_box()->text(), base::TRIM_ALL, &query);
query = base::i18n::ToLower(query);
model_->results()->DeleteAll();
diff --git a/base/command_line.cc b/base/command_line.cc
index cf36cab..eb3da4b 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -74,7 +74,7 @@ void AppendSwitchesAndArguments(CommandLine& command_line,
bool parse_switches = true;
for (size_t i = 1; i < argv.size(); ++i) {
CommandLine::StringType arg = argv[i];
- TrimWhitespace(arg, TRIM_ALL, &arg);
+ base::TrimWhitespace(arg, base::TRIM_ALL, &arg);
CommandLine::StringType switch_string;
CommandLine::StringType switch_value;
@@ -293,7 +293,7 @@ FilePath CommandLine::GetProgram() const {
}
void CommandLine::SetProgram(const FilePath& program) {
- TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]);
+ base::TrimWhitespace(program.value(), base::TRIM_ALL, &argv_[0]);
}
bool CommandLine::HasSwitch(const std::string& switch_string) const {
@@ -422,7 +422,7 @@ void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) {
#if defined(OS_WIN)
void CommandLine::ParseFromString(const std::wstring& command_line) {
std::wstring command_line_string;
- TrimWhitespace(command_line, TRIM_ALL, &command_line_string);
+ base::TrimWhitespace(command_line, base::TRIM_ALL, &command_line_string);
if (command_line_string.empty())
return;
diff --git a/base/i18n/file_util_icu.cc b/base/i18n/file_util_icu.cc
index 3864d22..e250c29 100644
--- a/base/i18n/file_util_icu.cc
+++ b/base/i18n/file_util_icu.cc
@@ -97,7 +97,7 @@ void ReplaceIllegalCharactersInPath(base::FilePath::StringType* file_name,
DCHECK(!(IllegalCharacters::GetInstance()->contains(replace_char)));
// Remove leading and trailing whitespace.
- TrimWhitespace(*file_name, TRIM_ALL, file_name);
+ base::TrimWhitespace(*file_name, base::TRIM_ALL, file_name);
IllegalCharacters* illegal = IllegalCharacters::GetInstance();
int cursor = 0; // The ICU macros expect an int.
diff --git a/base/linux_util.cc b/base/linux_util.cc
index f8dd2d0..1438ea2 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -176,7 +176,7 @@ std::string GetLinuxDistro() {
void SetLinuxDistro(const std::string& distro) {
std::string trimmed_distro;
- TrimWhitespaceASCII(distro, TRIM_ALL, &trimmed_distro);
+ base::TrimWhitespaceASCII(distro, base::TRIM_ALL, &trimmed_distro);
base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize);
}
diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc
index 215a4d3..51d0900 100644
--- a/base/nix/mime_util_xdg.cc
+++ b/base/nix/mime_util_xdg.cc
@@ -267,7 +267,7 @@ bool IconTheme::LoadIndexTheme(const FilePath& file) {
break;
std::string entry;
- TrimWhitespaceASCII(buf, TRIM_ALL, &entry);
+ base::TrimWhitespaceASCII(buf, base::TRIM_ALL, &entry);
if (entry.length() == 0 || entry[0] == '#') {
// Blank line or Comment.
continue;
@@ -284,10 +284,10 @@ bool IconTheme::LoadIndexTheme(const FilePath& file) {
if (r.size() < 2)
continue;
- TrimWhitespaceASCII(r[0], TRIM_ALL, &key);
+ base::TrimWhitespaceASCII(r[0], base::TRIM_ALL, &key);
for (size_t i = 1; i < r.size(); i++)
value.append(r[i]);
- TrimWhitespaceASCII(value, TRIM_ALL, &value);
+ base::TrimWhitespaceASCII(value, base::TRIM_ALL, &value);
if (current_info) {
if (key == "Size") {
@@ -366,7 +366,8 @@ bool IconTheme::SetDirectories(const std::string& dirs) {
std::string::size_type pos = 0, epos;
std::string dir;
while ((epos = dirs.find(',', pos)) != std::string::npos) {
- TrimWhitespaceASCII(dirs.substr(pos, epos - pos), TRIM_ALL, &dir);
+ base::TrimWhitespaceASCII(dirs.substr(pos, epos - pos), base::TRIM_ALL,
+ &dir);
if (dir.length() == 0) {
DLOG(WARNING) << "Invalid index.theme: blank subdir";
return false;
@@ -374,7 +375,7 @@ bool IconTheme::SetDirectories(const std::string& dirs) {
subdirs_[dir] = num++;
pos = epos + 1;
}
- TrimWhitespaceASCII(dirs.substr(pos), TRIM_ALL, &dir);
+ base::TrimWhitespaceASCII(dirs.substr(pos), base::TRIM_ALL, &dir);
if (dir.length() == 0) {
DLOG(WARNING) << "Invalid index.theme: blank subdir";
return false;
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc
index f6ab819..7fa5092 100644
--- a/base/process/process_metrics_linux.cc
+++ b/base/process/process_metrics_linux.cc
@@ -36,7 +36,7 @@ static uint64 ReadFileToUint64(const base::FilePath file) {
std::string file_as_string;
if (!ReadFileToString(file, &file_as_string))
return 0;
- TrimWhitespaceASCII(file_as_string, TRIM_ALL, &file_as_string);
+ base::TrimWhitespaceASCII(file_as_string, base::TRIM_ALL, &file_as_string);
uint64 file_as_uint64 = 0;
if (!base::StringToUint64(file_as_string, &file_as_uint64))
return 0;
@@ -71,7 +71,8 @@ size_t ReadProcStatusAndGetFieldAsSizeT(pid_t pid, const std::string& field) {
std::string value_str;
tokenizer.token_piece().CopyToString(&value_str);
std::string value_str_trimmed;
- TrimWhitespaceASCII(value_str, TRIM_ALL, &value_str_trimmed);
+ base::TrimWhitespaceASCII(value_str, base::TRIM_ALL,
+ &value_str_trimmed);
std::vector<std::string> split_value_str;
SplitString(value_str_trimmed, ' ', &split_value_str);
if (split_value_str.size() != 2 || split_value_str[1] != "kB") {
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index 4b102c5..c2e0e8a 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -242,18 +242,16 @@ void TruncateUTF8ToByteSize(const std::string& input,
output->clear();
}
-} // namespace base
-
-TrimPositions TrimWhitespace(const base::string16& input,
+TrimPositions TrimWhitespace(const string16& input,
TrimPositions positions,
- base::string16* output) {
- return base::TrimStringT(input, base::kWhitespaceUTF16, positions, output);
+ string16* output) {
+ return TrimStringT(input, kWhitespaceUTF16, positions, output);
}
TrimPositions TrimWhitespaceASCII(const std::string& input,
TrimPositions positions,
std::string* output) {
- return base::TrimStringT(input, base::kWhitespaceASCII, positions, output);
+ return TrimStringT(input, kWhitespaceASCII, positions, output);
}
// This function is only for backward-compatibility.
@@ -264,6 +262,8 @@ TrimPositions TrimWhitespace(const std::string& input,
return TrimWhitespaceASCII(input, positions, output);
}
+} // namespace base
+
template<typename STR>
STR CollapseWhitespaceT(const STR& text,
bool trim_sequences_with_line_breaks) {
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index 7b4b219..35805da 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -188,16 +188,6 @@ BASE_EXPORT void TruncateUTF8ToByteSize(const std::string& input,
const size_t byte_size,
std::string* output);
-} // namespace base
-
-#if defined(OS_WIN)
-#include "base/strings/string_util_win.h"
-#elif defined(OS_POSIX)
-#include "base/strings/string_util_posix.h"
-#else
-#error Define string operations appropriately for your platform
-#endif
-
// Trims any whitespace from either end of the input string. Returns where
// whitespace was found.
// The non-wide version has two functions:
@@ -211,7 +201,7 @@ enum TrimPositions {
TRIM_TRAILING = 1 << 1,
TRIM_ALL = TRIM_LEADING | TRIM_TRAILING,
};
-BASE_EXPORT TrimPositions TrimWhitespace(const base::string16& input,
+BASE_EXPORT TrimPositions TrimWhitespace(const string16& input,
TrimPositions positions,
base::string16* output);
BASE_EXPORT TrimPositions TrimWhitespaceASCII(const std::string& input,
@@ -224,6 +214,16 @@ BASE_EXPORT TrimPositions TrimWhitespace(const std::string& input,
TrimPositions positions,
std::string* output);
+} // namespace base
+
+#if defined(OS_WIN)
+#include "base/strings/string_util_win.h"
+#elif defined(OS_POSIX)
+#include "base/strings/string_util_posix.h"
+#else
+#error Define string operations appropriately for your platform
+#endif
+
// Searches for CR or LF characters. Removes all contiguous whitespace
// strings that contain them. This is useful when trying to deal with text
// copied from terminals.
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) {
diff --git a/chromeos/dbus/power_policy_controller.cc b/chromeos/dbus/power_policy_controller.cc
index 587dca4..368d978 100644
--- a/chromeos/dbus/power_policy_controller.cc
+++ b/chromeos/dbus/power_policy_controller.cc
@@ -129,7 +129,7 @@ std::string PowerPolicyController::GetPolicyDebugString(
}
if (policy.has_reason())
str += base::StringPrintf("reason=\"%s\" ", policy.reason().c_str());
- TrimWhitespace(str, TRIM_TRAILING, &str);
+ base::TrimWhitespace(str, base::TRIM_TRAILING, &str);
return str;
}
diff --git a/chromeos/system/name_value_pairs_parser.cc b/chromeos/system/name_value_pairs_parser.cc
index b5e11f4..efa5779 100644
--- a/chromeos/system/name_value_pairs_parser.cc
+++ b/chromeos/system/name_value_pairs_parser.cc
@@ -113,7 +113,7 @@ bool NameValuePairsParser::GetSingleValueFromTool(int argc,
if (!GetToolOutput(argc, argv, output_string))
return false;
- TrimWhitespaceASCII(output_string, TRIM_ALL, &output_string);
+ base::TrimWhitespaceASCII(output_string, base::TRIM_ALL, &output_string);
AddNameValuePair(key, output_string);
return true;
}
diff --git a/components/autofill/content/browser/wallet/required_action.cc b/components/autofill/content/browser/wallet/required_action.cc
index 28f9b20..8e90dded 100644
--- a/components/autofill/content/browser/wallet/required_action.cc
+++ b/components/autofill/content/browser/wallet/required_action.cc
@@ -35,7 +35,8 @@ bool ActionAppliesToWalletItems(RequiredAction action) {
RequiredAction ParseRequiredActionFromString(const std::string& str) {
std::string str_lower;
- TrimWhitespaceASCII(StringToLowerASCII(str), TRIM_ALL, &str_lower);
+ base::TrimWhitespaceASCII(StringToLowerASCII(str), base::TRIM_ALL,
+ &str_lower);
if (str_lower == "setup_wallet")
return SETUP_WALLET;
diff --git a/components/autofill/content/browser/wallet/wallet_client.cc b/components/autofill/content/browser/wallet/wallet_client.cc
index f0606f0..3c3c48e 100644
--- a/components/autofill/content/browser/wallet/wallet_client.cc
+++ b/components/autofill/content/browser/wallet/wallet_client.cc
@@ -65,9 +65,7 @@ std::string RiskCapabilityToString(
WalletClient::ErrorType StringToErrorType(const std::string& error_type) {
std::string trimmed;
- TrimWhitespaceASCII(error_type,
- TRIM_ALL,
- &trimmed);
+ base::TrimWhitespaceASCII(error_type, base::TRIM_ALL, &trimmed);
if (LowerCaseEqualsASCII(trimmed, "buyer_account_error"))
return WalletClient::BUYER_ACCOUNT_ERROR;
if (LowerCaseEqualsASCII(trimmed, "unsupported_merchant"))
@@ -92,9 +90,7 @@ WalletClient::ErrorType StringToErrorType(const std::string& error_type) {
WalletClient::ErrorType BuyerErrorStringToErrorType(
const std::string& message_type_for_buyer) {
std::string trimmed;
- TrimWhitespaceASCII(message_type_for_buyer,
- TRIM_ALL,
- &trimmed);
+ base::TrimWhitespaceASCII(message_type_for_buyer, base::TRIM_ALL, &trimmed);
if (LowerCaseEqualsASCII(trimmed, "bla_country_not_supported"))
return WalletClient::BUYER_LEGAL_ADDRESS_NOT_SUPPORTED;
if (LowerCaseEqualsASCII(trimmed, "buyer_kyc_error"))
@@ -632,9 +628,7 @@ void WalletClient::OnURLFetchComplete(
std::string auth_result;
if (response_dict->GetString(kAuthResultKey, &auth_result)) {
std::string trimmed;
- TrimWhitespaceASCII(auth_result,
- TRIM_ALL,
- &trimmed);
+ base::TrimWhitespaceASCII(auth_result, base::TRIM_ALL, &trimmed);
delegate_->OnDidAuthenticateInstrument(
LowerCaseEqualsASCII(trimmed, "success"));
} else {
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index 16849bb..f172bbc 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -77,8 +77,10 @@ void GetDataListSuggestions(const blink::WebInputElement& element,
element.formControlType() == WebString::fromUTF8("email")) {
std::vector<base::string16> parts;
base::SplitStringDontTrim(prefix, ',', &parts);
- if (parts.size() > 0)
- TrimWhitespace(parts[parts.size() - 1], TRIM_LEADING, &prefix);
+ if (parts.size() > 0) {
+ base::TrimWhitespace(parts[parts.size() - 1], base::TRIM_LEADING,
+ &prefix);
+ }
}
}
for (WebOptionElement option = options.firstItem().to<WebOptionElement>();
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 66ceaf6..8adf116 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -115,13 +115,13 @@ const base::string16 CombineAndCollapseWhitespace(
const base::string16& suffix,
bool force_whitespace) {
base::string16 prefix_trimmed;
- TrimPositions prefix_trailing_whitespace =
- TrimWhitespace(prefix, TRIM_TRAILING, &prefix_trimmed);
+ base::TrimPositions prefix_trailing_whitespace =
+ base::TrimWhitespace(prefix, base::TRIM_TRAILING, &prefix_trimmed);
// Recursively compute the children's text.
base::string16 suffix_trimmed;
- TrimPositions suffix_leading_whitespace =
- TrimWhitespace(suffix, TRIM_LEADING, &suffix_trimmed);
+ base::TrimPositions suffix_leading_whitespace =
+ base::TrimWhitespace(suffix, base::TRIM_LEADING, &suffix_trimmed);
if (prefix_trailing_whitespace || suffix_leading_whitespace ||
force_whitespace) {
@@ -190,7 +190,7 @@ base::string16 FindChildText(const WebNode& node) {
const int kChildSearchDepth = 10;
base::string16 node_text = FindChildTextInner(child, kChildSearchDepth);
- TrimWhitespace(node_text, TRIM_ALL, &node_text);
+ base::TrimWhitespace(node_text, base::TRIM_ALL, &node_text);
return node_text;
}
@@ -242,7 +242,7 @@ base::string16 InferLabelFromPrevious(const WebFormControlElement& element) {
// If we have identified a partial label and have reached a non-lightweight
// element, consider the label to be complete.
base::string16 trimmed_label;
- TrimWhitespace(inferred_label, TRIM_ALL, &trimmed_label);
+ base::TrimWhitespace(inferred_label, base::TRIM_ALL, &trimmed_label);
if (!trimmed_label.empty())
break;
@@ -262,7 +262,7 @@ base::string16 InferLabelFromPrevious(const WebFormControlElement& element) {
break;
}
- TrimWhitespace(inferred_label, TRIM_ALL, &inferred_label);
+ base::TrimWhitespace(inferred_label, base::TRIM_ALL, &inferred_label);
return inferred_label;
}
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 0934871..f0d18b6 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -144,7 +144,7 @@ void DeterminePossibleFieldTypesForUpload(
matching_types.insert(autofill::PASSWORD);
} else {
base::string16 value;
- TrimWhitespace(field->value, TRIM_ALL, &value);
+ base::TrimWhitespace(field->value, base::TRIM_ALL, &value);
for (std::vector<AutofillProfile>::const_iterator it = profiles.begin();
it != profiles.end(); ++it) {
it->GetMatchingTypes(value, app_locale, &matching_types);
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 16e9174..661387a 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -307,7 +307,7 @@ bool AutofillProfile::SetInfo(const AutofillType& type,
return false;
base::string16 trimmed_value;
- TrimWhitespace(value, TRIM_ALL, &trimmed_value);
+ base::TrimWhitespace(value, base::TRIM_ALL, &trimmed_value);
return form_group->SetInfo(type, trimmed_value, app_locale);
}
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index da70ce2..7fd24c5 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -249,7 +249,7 @@ bool PersonalDataManager::ImportFormData(
for (size_t i = 0; i < form.field_count(); ++i) {
const AutofillField* field = form.field(i);
base::string16 value;
- TrimWhitespace(field->value, TRIM_ALL, &value);
+ base::TrimWhitespace(field->value, base::TRIM_ALL, &value);
// If we don't know the type of the field, or the user hasn't entered any
// information into the field, then skip it.
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
index 177785d..e1edf73 100644
--- a/components/autofill/core/browser/validation.cc
+++ b/components/autofill/core/browser/validation.cc
@@ -28,8 +28,8 @@ bool IsValidCreditCardExpirationDate(const base::string16& year,
const base::string16& month,
const base::Time& now) {
base::string16 year_cleaned, month_cleaned;
- TrimWhitespace(year, TRIM_ALL, &year_cleaned);
- TrimWhitespace(month, TRIM_ALL, &month_cleaned);
+ base::TrimWhitespace(year, base::TRIM_ALL, &year_cleaned);
+ base::TrimWhitespace(month, base::TRIM_ALL, &month_cleaned);
if (year_cleaned.length() != 4)
return false;
diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc
index 3ad1799..351b955 100644
--- a/components/plugins/renderer/plugin_placeholder.cc
+++ b/components/plugins/renderer/plugin_placeholder.cc
@@ -126,14 +126,14 @@ void PluginPlaceholder::HidePlugin() {
if (EndsWith(width_str, "px", false)) {
width_str = width_str.substr(0, width_str.length() - 2);
}
- TrimWhitespace(width_str, TRIM_TRAILING, &width_str);
+ base::TrimWhitespace(width_str, base::TRIM_TRAILING, &width_str);
width_str += "[\\s]*px";
std::string height_str("height:[\\s]*");
height_str += element.getAttribute("height").utf8().data();
if (EndsWith(height_str, "px", false)) {
height_str = height_str.substr(0, height_str.length() - 2);
}
- TrimWhitespace(height_str, TRIM_TRAILING, &height_str);
+ base::TrimWhitespace(height_str, base::TRIM_TRAILING, &height_str);
height_str += "[\\s]*px";
WebNode parent = element;
while (!parent.parentNode().isNull()) {
diff --git a/components/translate/language_detection/language_detection_util.cc b/components/translate/language_detection/language_detection_util.cc
index 6bf05cc..b452549 100644
--- a/components/translate/language_detection/language_detection_util.cc
+++ b/components/translate/language_detection/language_detection_util.cc
@@ -278,7 +278,7 @@ void CorrectLanguageCodeTypo(std::string* code) {
// There are more than 1 language specified, just keep the first one.
*code = code->substr(0, coma_index);
}
- TrimWhitespaceASCII(*code, TRIM_ALL, code);
+ base::TrimWhitespaceASCII(*code, base::TRIM_ALL, code);
// An underscore instead of a dash is a frequent mistake.
size_t underscore_index = code->find('_');
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5a712ff..b573d67 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2617,7 +2617,7 @@ bool WebContentsImpl::UpdateTitleForEntry(NavigationEntryImpl* entry,
final_title = base::UTF8ToUTF16(entry->GetURL().ExtractFileName());
explicit_set = false; // Don't count synthetic titles toward the set limit.
} else {
- TrimWhitespace(title, TRIM_ALL, &final_title);
+ base::TrimWhitespace(title, base::TRIM_ALL, &final_title);
explicit_set = true;
}
diff --git a/content/child/npapi/plugin_host.cc b/content/child/npapi/plugin_host.cc
index f393c7e..e0ac05d 100644
--- a/content/child/npapi/plugin_host.cc
+++ b/content/child/npapi/plugin_host.cc
@@ -262,7 +262,7 @@ bool PluginHost::SetPostData(const char* buf,
case GETNAME:
// Got a value.
value = std::string(start, ptr - start);
- TrimWhitespace(value, TRIM_ALL, &value);
+ base::TrimWhitespace(value, base::TRIM_ALL, &value);
// If the name field is empty, we'll skip this header
// but we won't error out.
if (!name.empty() && name != "content-length") {
@@ -274,7 +274,7 @@ bool PluginHost::SetPostData(const char* buf,
case GETVALUE:
// Got a header.
name = StringToLowerASCII(std::string(start, ptr - start));
- TrimWhitespace(name, TRIM_ALL, &name);
+ base::TrimWhitespace(name, base::TRIM_ALL, &name);
start = ptr + 1;
break;
case GETDATA: {
diff --git a/content/renderer/npapi/webplugin_impl_unittest.cc b/content/renderer/npapi/webplugin_impl_unittest.cc
index dd3b83e..4576ea4 100644
--- a/content/renderer/npapi/webplugin_impl_unittest.cc
+++ b/content/renderer/npapi/webplugin_impl_unittest.cc
@@ -19,9 +19,9 @@ namespace {
std::string GetHeader(const WebURLRequest& request, const char* name) {
std::string result;
- TrimWhitespace(
+ base::TrimWhitespace(
request.httpHeaderField(WebString::fromUTF8(name)).utf8(),
- TRIM_ALL,
+ base::TRIM_ALL,
&result);
return result;
}
diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc
index 1be8152..6c60f47 100644
--- a/content/renderer/p2p/port_allocator.cc
+++ b/content/renderer/p2p/port_allocator.cc
@@ -225,8 +225,8 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
it != value_pairs.end(); ++it) {
std::string key;
std::string value;
- TrimWhitespaceASCII(it->first, TRIM_ALL, &key);
- TrimWhitespaceASCII(it->second, TRIM_ALL, &value);
+ base::TrimWhitespaceASCII(it->first, base::TRIM_ALL, &key);
+ base::TrimWhitespaceASCII(it->second, base::TRIM_ALL, &value);
if (key == "username") {
if (value != username()) {
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 175b523..7963113 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -806,12 +806,13 @@ bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams(
const int start = selection_range.GetMin() - selection_text_offset;
const size_t length = selection_range.length();
if (start >= 0 && start + length <= selection_text.length()) {
- TrimWhitespace(selection_text.substr(start, length), TRIM_ALL,
- &trimmed_selection_text);
+ base::TrimWhitespace(selection_text.substr(start, length), base::TRIM_ALL,
+ &trimmed_selection_text);
}
}
base::string16 trimmed_params_text;
- TrimWhitespace(params.selection_text, TRIM_ALL, &trimmed_params_text);
+ base::TrimWhitespace(params.selection_text, base::TRIM_ALL,
+ &trimmed_params_text);
return trimmed_params_text != trimmed_selection_text;
}
diff --git a/extensions/common/feature_switch.cc b/extensions/common/feature_switch.cc
index 1108346..55b54ce 100644
--- a/extensions/common/feature_switch.cc
+++ b/extensions/common/feature_switch.cc
@@ -110,7 +110,7 @@ bool FeatureSwitch::IsEnabled() const {
std::string temp = command_line_->GetSwitchValueASCII(switch_name_);
std::string switch_value;
- TrimWhitespaceASCII(temp, TRIM_ALL, &switch_value);
+ base::TrimWhitespaceASCII(temp, base::TRIM_ALL, &switch_value);
if (switch_value == "1")
return true;
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc
index 437574d..2318b50 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -266,12 +266,12 @@ bool OAuth2MintTokenFlow::ParseIssueAdviceResponse(
break;
}
- TrimWhitespace(entry.description, TRIM_ALL, &entry.description);
+ base::TrimWhitespace(entry.description, base::TRIM_ALL, &entry.description);
static const base::string16 detail_separators =
base::ASCIIToUTF16(kDetailSeparators);
Tokenize(detail, detail_separators, &entry.details);
for (size_t i = 0; i < entry.details.size(); i++)
- TrimWhitespace(entry.details[i], TRIM_ALL, &entry.details[i]);
+ base::TrimWhitespace(entry.details[i], base::TRIM_ALL, &entry.details[i]);
issue_advice->push_back(entry);
}
diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc
index cd82f51..6ae4754 100644
--- a/net/base/host_mapping_rules.cc
+++ b/net/base/host_mapping_rules.cc
@@ -67,7 +67,7 @@ bool HostMappingRules::RewriteHost(HostPortPair* host_port) const {
bool HostMappingRules::AddRuleFromString(const std::string& rule_string) {
std::string trimmed;
- TrimWhitespaceASCII(rule_string, TRIM_ALL, &trimmed);
+ base::TrimWhitespaceASCII(rule_string, base::TRIM_ALL, &trimmed);
std::vector<std::string> parts;
base::SplitString(trimmed, ' ', &parts);
diff --git a/net/base/ip_mapping_rules.cc b/net/base/ip_mapping_rules.cc
index 4f7b7aa..fbc887d 100644
--- a/net/base/ip_mapping_rules.cc
+++ b/net/base/ip_mapping_rules.cc
@@ -66,7 +66,7 @@ bool IPMappingRules::RewriteAddresses(AddressList* addresses) const {
bool IPMappingRules::AddRuleFromString(const std::string& rule_string) {
std::string trimmed;
- TrimWhitespaceASCII(rule_string, TRIM_ALL, &trimmed);
+ base::TrimWhitespaceASCII(rule_string, base::TRIM_ALL, &trimmed);
if (trimmed.empty())
return true; // Allow empty rules.
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index a373432..9e1ebe5 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -767,7 +767,7 @@ void SanitizeGeneratedFileName(base::FilePath::StringType* filename,
size_t length = filename->size();
size_t pos = filename->find_last_not_of(FILE_PATH_LITERAL(" ."));
filename->resize((pos == std::string::npos) ? 0 : (pos + 1));
- TrimWhitespace(*filename, TRIM_TRAILING, filename);
+ base::TrimWhitespace(*filename, base::TRIM_TRAILING, filename);
if (filename->empty())
return;
size_t trimmed = length - filename->size();
@@ -1058,8 +1058,9 @@ std::string GetSpecificHeader(const std::string& headers,
begin += match.length();
std::string ret;
- TrimWhitespace(std::string(begin, std::find(begin, headers.end(), '\n')),
- TRIM_ALL, &ret);
+ base::TrimWhitespace(std::string(begin,
+ std::find(begin, headers.end(), '\n')),
+ base::TRIM_ALL, &ret);
return ret;
}
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index 8ff0f60..b558066 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -366,7 +366,7 @@ base::string16 FtpUtil::GetStringPartAfterColumns(const base::string16& text,
}
base::string16 result(text.substr(iter.array_pos()));
- TrimWhitespace(result, TRIM_ALL, &result);
+ base::TrimWhitespace(result, base::TRIM_ALL, &result);
return result;
}
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
index 738f0c1..1c1e54b 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -288,7 +288,7 @@ std::string DhcpProxyScriptAdapterFetcher::SanitizeDhcpApiString(
// the server is giving us back a buffer with embedded NULLs,
// something is broken anyway. Finally, trim trailing whitespace.
std::string result(std::string(data, count_bytes).c_str());
- TrimWhitespaceASCII(result, TRIM_TRAILING, &result);
+ base::TrimWhitespaceASCII(result, base::TRIM_TRAILING, &result);
return result;
}
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index a60adc3..b902655 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -262,7 +262,7 @@ bool ProxyBypassRules::AddRuleFromStringInternal(
const std::string& raw_untrimmed,
bool use_hostname_suffix_matching) {
std::string raw;
- TrimWhitespaceASCII(raw_untrimmed, TRIM_ALL, &raw);
+ base::TrimWhitespaceASCII(raw_untrimmed, base::TRIM_ALL, &raw);
// This is the special syntax used by WinInet's bypass list -- we allow it
// on all platforms and interpret it the same way.
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index c1fe0f5..86c5284 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -112,7 +112,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
}
// Trim whitespace off the url scheme.
- TrimWhitespaceASCII(url_scheme, TRIM_ALL, &url_scheme);
+ base::TrimWhitespaceASCII(url_scheme, base::TRIM_ALL, &url_scheme);
// Add it to the per-scheme mappings (if supported scheme).
type = TYPE_PROXY_PER_SCHEME;
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 088621d..25276e8 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -106,7 +106,7 @@ void AddBypassRules(const std::string& scheme,
while (tokenizer.GetNext()) {
std::string token = tokenizer.token();
std::string pattern;
- TrimWhitespaceASCII(token, TRIM_ALL, &pattern);
+ base::TrimWhitespaceASCII(token, base::TRIM_ALL, &pattern);
if (pattern.empty())
continue;
// '?' is not one of the specified pattern characters above.
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index 4bbe0cb..cb3ddea 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -1215,8 +1215,8 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter,
*(split++) = 0;
std::string key = line;
std::string value = split;
- TrimWhitespaceASCII(key, TRIM_ALL, &key);
- TrimWhitespaceASCII(value, TRIM_ALL, &value);
+ base::TrimWhitespaceASCII(key, base::TRIM_ALL, &key);
+ base::TrimWhitespaceASCII(value, base::TRIM_ALL, &value);
// Skip this line if the key name is empty.
if (key.empty())
continue;
@@ -1230,7 +1230,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter,
// Trim the localization indicator off.
key.resize(length);
// Remove any resulting trailing whitespace.
- TrimWhitespaceASCII(key, TRIM_TRAILING, &key);
+ base::TrimWhitespaceASCII(key, base::TRIM_TRAILING, &key);
// Skip this line if the key name is now empty.
if (key.empty())
continue;
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index a51feb8..b8e300f 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -281,7 +281,7 @@ bool HttpServer::ParseHeaders(HttpConnection* connection,
buffer.clear();
break;
case ST_VALUE:
- TrimWhitespaceASCII(buffer, TRIM_LEADING, &header_value);
+ base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value);
// TODO(mbelshe): Deal better with duplicate headers
DCHECK(info->headers.find(header_name) == info->headers.end());
info->headers[header_name] = header_value;
diff --git a/net/test/python_utils_unittest.cc b/net/test/python_utils_unittest.cc
index 04f11ec..64b4f7a 100644
--- a/net/test/python_utils_unittest.cc
+++ b/net/test/python_utils_unittest.cc
@@ -56,6 +56,6 @@ TEST(PythonUtils, PythonRunTime) {
cmd_line.AppendArg(python_cmd);
std::string output;
EXPECT_TRUE(base::GetAppOutput(cmd_line, &output));
- TrimWhitespace(output, TRIM_TRAILING, &output);
+ base::TrimWhitespace(output, base::TRIM_TRAILING, &output);
EXPECT_EQ(input, output);
}
diff --git a/ppapi/proxy/file_chooser_resource.cc b/ppapi/proxy/file_chooser_resource.cc
index 9847e29..0642568 100644
--- a/ppapi/proxy/file_chooser_resource.cc
+++ b/ppapi/proxy/file_chooser_resource.cc
@@ -84,7 +84,7 @@ void FileChooserResource::PopulateAcceptTypes(
for (size_t i = 0; i < type_list.size(); ++i) {
std::string type = type_list[i];
- TrimWhitespaceASCII(type, TRIM_ALL, &type);
+ base::TrimWhitespaceASCII(type, base::TRIM_ALL, &type);
// If the type is a single character, it definitely cannot be valid. In the
// case of a file extension it would be a single ".". In the case of a MIME
diff --git a/printing/backend/cups_helper.cc b/printing/backend/cups_helper.cc
index 5636f08..6a0e220 100644
--- a/printing/backend/cups_helper.cc
+++ b/printing/backend/cups_helper.cc
@@ -62,7 +62,7 @@ void ParseLpOptions(const base::FilePath& filepath,
continue;
}
- TrimWhitespaceASCII(line, TRIM_ALL, &line);
+ base::TrimWhitespaceASCII(line, base::TRIM_ALL, &line);
if (line.empty())
continue;
@@ -80,7 +80,8 @@ void ParseLpOptions(const base::FilePath& filepath,
}
line = line.substr(space_found + 1);
- TrimWhitespaceASCII(line, TRIM_ALL, &line); // Remove extra spaces.
+ // Remove extra spaces.
+ base::TrimWhitespaceASCII(line, base::TRIM_ALL, &line);
if (line.empty())
continue;
// Parse the selected printer custom options.
diff --git a/remoting/host/setup/daemon_controller_delegate_linux.cc b/remoting/host/setup/daemon_controller_delegate_linux.cc
index 7e78046..d925369 100644
--- a/remoting/host/setup/daemon_controller_delegate_linux.cc
+++ b/remoting/host/setup/daemon_controller_delegate_linux.cc
@@ -152,7 +152,7 @@ DaemonController::State DaemonControllerDelegateLinux::GetState() {
return DaemonController::STATE_UNKNOWN;
}
- TrimWhitespaceASCII(status, TRIM_ALL, &status);
+ base::TrimWhitespaceASCII(status, base::TRIM_ALL, &status);
if (status == "STARTED") {
return DaemonController::STATE_STARTED;
@@ -290,7 +290,7 @@ std::string DaemonControllerDelegateLinux::GetVersion() {
return std::string();
}
- TrimWhitespaceASCII(version, TRIM_ALL, &version);
+ base::TrimWhitespaceASCII(version, base::TRIM_ALL, &version);
if (!ContainsOnlyChars(version, "0123456789.")) {
LOG(ERROR) << "Received invalid host version number: " << version;
return std::string();
diff --git a/rlz/lib/rlz_lib.cc b/rlz/lib/rlz_lib.cc
index b204fe9..39bec27 100644
--- a/rlz/lib/rlz_lib.cc
+++ b/rlz/lib/rlz_lib.cc
@@ -103,7 +103,7 @@ void GetEventsFromResponseString(
std::vector<ReturnedEvent>* event_array) {
// Get the string of events.
std::string events = response_line.substr(field_header.size());
- TrimWhitespaceASCII(events, TRIM_LEADING, &events);
+ base::TrimWhitespaceASCII(events, base::TRIM_LEADING, &events);
int events_length = events.find_first_of("\r\n ");
if (events_length < 0)
@@ -438,7 +438,7 @@ bool IsPingResponseValid(const char* response, int* checksum_idx) {
int checksum_begin = checksum_index + checksum_param.size();
std::string checksum = response_string.substr(checksum_begin,
checksum_end - checksum_begin + 1);
- TrimWhitespaceASCII(checksum, TRIM_ALL, &checksum);
+ base::TrimWhitespaceASCII(checksum, base::TRIM_ALL, &checksum);
if (checksum_idx)
*checksum_idx = checksum_index;
@@ -549,7 +549,7 @@ bool ParsePingResponse(Product product, const char* response) {
// Get the new RLZ.
std::string rlz_value(response_line.substr(separator_index + 2));
- TrimWhitespaceASCII(rlz_value, TRIM_LEADING, &rlz_value);
+ base::TrimWhitespaceASCII(rlz_value, base::TRIM_LEADING, &rlz_value);
size_t rlz_length = rlz_value.find_first_of("\r\n ");
if (rlz_length == std::string::npos)
diff --git a/third_party/leveldatabase/env_chromium_win.cc b/third_party/leveldatabase/env_chromium_win.cc
index b8ce1a7..1b8da17 100644
--- a/third_party/leveldatabase/env_chromium_win.cc
+++ b/third_party/leveldatabase/env_chromium_win.cc
@@ -30,7 +30,7 @@ static std::string GetWindowsErrorMessage(DWORD err) {
if (errorText != NULL) {
std::string message(base::UTF16ToUTF8(errorText));
// FormatMessage adds CR/LF to messages so we remove it.
- TrimWhitespace(message, TRIM_TRAILING, &message);
+ base::TrimWhitespace(message, base::TRIM_TRAILING, &message);
LocalFree(errorText);
return message;
} else {
diff --git a/tools/gn/input_conversion.cc b/tools/gn/input_conversion.cc
index c22789a..246b4c9 100644
--- a/tools/gn/input_conversion.cc
+++ b/tools/gn/input_conversion.cc
@@ -132,7 +132,7 @@ Value DoConvertInputToValue(const std::string& input,
const char kTrimPrefix[] = "trim ";
if (StartsWithASCII(input_conversion, kTrimPrefix, true)) {
std::string trimmed;
- TrimWhitespaceASCII(input, TRIM_ALL, &trimmed);
+ base::TrimWhitespaceASCII(input, base::TRIM_ALL, &trimmed);
// Remove "trim" prefix from the input conversion and re-run.
return DoConvertInputToValue(
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index 5f30cf8..0c969ab 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -319,7 +319,7 @@ void Setup::FillPythonPath() {
L"cmd.exe /c python -c \"import sys; print sys.executable\"";
std::string python_path;
if (base::GetAppOutput(kGetPython, &python_path)) {
- TrimWhitespaceASCII(python_path, TRIM_ALL, &python_path);
+ base::TrimWhitespaceASCII(python_path, base::TRIM_ALL, &python_path);
if (scheduler_.verbose_logging())
scheduler_.Log("Found python", python_path);
} else {
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index 7bf0e3a..b8958f4 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -334,7 +334,7 @@ void AppListModelObserverBridge::OnProfilesChanged() {
return;
base::string16 query;
- TrimWhitespace(searchBoxModel->text(), TRIM_ALL, &query);
+ base::TrimWhitespace(searchBoxModel->text(), base::TRIM_ALL, &query);
BOOL shouldShowSearch = !query.empty();
[self revealSearchResults:shouldShowSearch];
if (shouldShowSearch)
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index ad5e2eb..6b6f65a 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -220,7 +220,7 @@ void AppListMainView::GetShortcutPathForApp(
void AppListMainView::QueryChanged(SearchBoxView* sender) {
base::string16 query;
- TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query);
+ base::TrimWhitespace(model_->search_box()->text(), base::TRIM_ALL, &query);
bool should_show_search = !query.empty();
contents_view_->ShowSearchResults(should_show_search);
diff --git a/ui/base/clipboard/clipboard_util_win.cc b/ui/base/clipboard/clipboard_util_win.cc
index 1a42e32..85f8e1d 100644
--- a/ui/base/clipboard/clipboard_util_win.cc
+++ b/ui/base/clipboard/clipboard_util_win.cc
@@ -456,7 +456,7 @@ void ClipboardUtil::CFHtmlToHtml(const std::string& cf_html,
fragment_start != std::string::npos &&
fragment_end != std::string::npos) {
*html = cf_html.substr(fragment_start, fragment_end - fragment_start);
- TrimWhitespace(*html, TRIM_ALL, html);
+ base::TrimWhitespace(*html, base::TRIM_ALL, html);
}
}
@@ -474,7 +474,7 @@ void ClipboardUtil::CFHtmlExtractMetadata(const std::string& cf_html,
size_t src_start = line_start + src_url_str.length();
if (src_end != std::string::npos && src_start != std::string::npos) {
*base_url = cf_html.substr(src_start, src_end - src_start);
- TrimWhitespace(*base_url, TRIM_ALL, base_url);
+ base::TrimWhitespace(*base_url, base::TRIM_ALL, base_url);
}
}
}
diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc
index ab363e4..4426718 100644
--- a/ui/gfx/font_fallback_win.cc
+++ b/ui/gfx/font_fallback_win.cc
@@ -180,7 +180,8 @@ void ParseFontFamilyString(const std::string& family,
const size_t index = font_names->back().find('(');
if (index != std::string::npos) {
font_names->back().resize(index);
- TrimWhitespace(font_names->back(), TRIM_TRAILING, &font_names->back());
+ base::TrimWhitespace(font_names->back(), base::TRIM_TRAILING,
+ &font_names->back());
}
}
}
diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc
index 545b203..3209cc2 100644
--- a/ui/gfx/text_elider.cc
+++ b/ui/gfx/text_elider.cc
@@ -580,7 +580,7 @@ int RectangleText::Finalize() {
// Remove trailing whitespace from the last line or remove the last line
// completely, if it's just whitespace.
if (!insufficient_height_ && !lines_->empty()) {
- TrimWhitespace(lines_->back(), TRIM_TRAILING, &lines_->back());
+ base::TrimWhitespace(lines_->back(), base::TRIM_TRAILING, &lines_->back());
if (lines_->back().empty() && !last_line_ended_in_lf_)
lines_->pop_back();
}
@@ -608,7 +608,8 @@ void RectangleText::AddLine(const base::string16& line) {
if (truncate) {
// Trim trailing whitespace from the line that was added.
const int line = lines_->size() - lines_added;
- TrimWhitespace(lines_->at(line), TRIM_TRAILING, &lines_->at(line));
+ base::TrimWhitespace(lines_->at(line), base::TRIM_TRAILING,
+ &lines_->at(line));
}
if (ContainsOnlyWhitespace(word)) {
// Skip the first space if the previous line was carried over.
@@ -677,7 +678,7 @@ int RectangleText::AddWordOverflow(const base::string16& word) {
int RectangleText::AddWord(const base::string16& word) {
int lines_added = 0;
base::string16 trimmed;
- TrimWhitespace(word, TRIM_TRAILING, &trimmed);
+ base::TrimWhitespace(word, base::TRIM_TRAILING, &trimmed);
const float trimmed_width = GetStringWidthF(trimmed, font_list_);
if (trimmed_width <= available_pixel_width_) {
// Word can be made to fit, no need to fragment it.
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc
index d707b6f..24d9862 100644
--- a/ui/views/controls/styled_label.cc
+++ b/ui/views/controls/styled_label.cc
@@ -97,7 +97,7 @@ StyledLabel::StyledLabel(const base::string16& text,
: listener_(listener),
displayed_on_background_color_set_(false),
auto_color_readability_enabled_(true) {
- TrimWhitespace(text, TRIM_TRAILING, &text_);
+ base::TrimWhitespace(text, base::TRIM_TRAILING, &text_);
}
StyledLabel::~StyledLabel() {}
@@ -202,8 +202,10 @@ gfx::Size StyledLabel::CalculateAndDoLayout(int width, bool dry_run) {
while (!remaining_string.empty()) {
// Don't put whitespace at beginning of a line with an exception for the
// first line (so the text's leading whitespace is respected).
- if (x == 0 && line > 0)
- TrimWhitespace(remaining_string, TRIM_LEADING, &remaining_string);
+ if (x == 0 && line > 0) {
+ base::TrimWhitespace(remaining_string, base::TRIM_LEADING,
+ &remaining_string);
+ }
gfx::Range range(gfx::Range::InvalidRange());
if (current_range != style_ranges_.end())
@@ -237,7 +239,8 @@ gfx::Size StyledLabel::CalculateAndDoLayout(int width, bool dry_run) {
// anything; abort.
if (x == 0) {
if (line == 0) {
- TrimWhitespace(remaining_string, TRIM_LEADING, &remaining_string);
+ base::TrimWhitespace(remaining_string, base::TRIM_LEADING,
+ &remaining_string);
continue;
}
break;
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc
index 6905cc2..c5e621b 100644
--- a/ui/views/corewm/tooltip_controller.cc
+++ b/ui/views/corewm/tooltip_controller.cc
@@ -288,7 +288,8 @@ void TooltipController::UpdateIfRequired() {
// If the string consists entirely of whitespace, then don't both showing it
// (an empty tooltip is useless).
base::string16 whitespace_removed_text;
- TrimWhitespace(trimmed_text, TRIM_ALL, &whitespace_removed_text);
+ base::TrimWhitespace(trimmed_text, base::TRIM_ALL,
+ &whitespace_removed_text);
if (whitespace_removed_text.empty()) {
tooltip_->Hide();
} else {
diff --git a/win8/delegate_execute/delegate_execute_util.cc b/win8/delegate_execute/delegate_execute_util.cc
index c3097a2..78203ed 100644
--- a/win8/delegate_execute/delegate_execute_util.cc
+++ b/win8/delegate_execute/delegate_execute_util.cc
@@ -43,7 +43,7 @@ base::string16 ParametersFromSwitch(const char* a_switch) {
cmd_line.AppendSwitch(a_switch);
base::string16 command_string(cmd_line.GetCommandLineString());
- TrimWhitespace(command_string, TRIM_ALL, &command_string);
+ base::TrimWhitespace(command_string, base::TRIM_ALL, &command_string);
return command_string;
}