Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Unified Diff: ui/gfx/text_elider.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/font_fallback_win.cc ('k') | ui/views/controls/styled_label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_elider.cc
diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc
index 545b2034c30619fb581c283f14bf384d3feb1d73..3209cc2d0b0af327f7d8cdd1390b620d3f7aa321 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.
« no previous file with comments | « ui/gfx/font_fallback_win.cc ('k') | ui/views/controls/styled_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698