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

Issue 10386016: Modify ui::ElideRectangleText() to honor trailing newlines. (Closed)

Created:
8 years, 7 months ago by Alexei Svitkine (slow)
Modified:
8 years, 7 months ago
Reviewers:
brettw, sky
CC:
chromium-reviews, erikwright (departed), jshin+watch_chromium.org, brettw-cc_chromium.org, xji, tfarina
Visibility:
Public.

Description

Modify ui::ElideRectangleText() to honor trailing newlines. Trailing whitespace without a \n character is still trimmed away. Adds additional tests for this. Also, makes the code use ContainsOnlyWhitespace() from base and makes the implementation of ContainsOnlyWhitespace() shorter (based on the code that was in text_elider.cc.) BUG=126297 TEST=New tests in text_elider_unittest.cc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=137061

Patch Set 1 : #

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -25 lines) Patch
M base/string_util.cc View 1 1 chunk +1 line, -5 lines 2 comments Download
M ui/base/text/text_elider.cc View 1 7 chunks +12 lines, -11 lines 0 comments Download
M ui/base/text/text_elider_unittest.cc View 1 4 chunks +22 lines, -9 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Alexei Svitkine (slow)
8 years, 7 months ago (2012-05-11 17:04:11 UTC) #1
sky
LGTM
8 years, 7 months ago (2012-05-11 17:32:14 UTC) #2
Alexei Svitkine (slow)
+brettw for base/ ownership
8 years, 7 months ago (2012-05-11 17:36:55 UTC) #3
brettw
base LGTM
8 years, 7 months ago (2012-05-11 21:36:20 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/10386016/12002
8 years, 7 months ago (2012-05-15 00:26:29 UTC) #5
commit-bot: I haz the power
Change committed as 137061
8 years, 7 months ago (2012-05-15 02:43:12 UTC) #6
tfarina
https://chromiumcodereview.appspot.com/10386016/diff/12002/base/string_util.cc File base/string_util.cc (right): https://chromiumcodereview.appspot.com/10386016/diff/12002/base/string_util.cc#newcode381 base/string_util.cc:381: for (std::string::const_iterator i(str.begin()); i != str.end(); ++i) { Can ...
8 years, 7 months ago (2012-05-15 02:49:52 UTC) #7
Alexei Svitkine (slow)
8 years, 7 months ago (2012-05-15 03:04:22 UTC) #8
https://chromiumcodereview.appspot.com/10386016/diff/12002/base/string_util.cc
File base/string_util.cc (right):

https://chromiumcodereview.appspot.com/10386016/diff/12002/base/string_util.c...
base/string_util.cc:381: for (std::string::const_iterator i(str.begin()); i !=
str.end(); ++i) {
On 2012/05/15 02:49:52, tfarina wrote:
> Can we simplify this as well?

I considered it, but unfortunately kWhitespaceASCII is not the same set as
what's checked by IsAsciiWhitespace() and I didn't want to change any behaviour
here with this cleanup.

(I don't understand the implications of this change to judge whether it would be
correct to make it.)

Powered by Google App Engine
This is Rietveld 408576698