summaryrefslogtreecommitdiffstats
path: root/base/string_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* Linux: fix bookmarks with & in them not showing correctly in the wrench menu.mdm@chromium.org2012-02-151-4/+4
| | | | | | | | | | | | As a side effect, also fix a bug in ReplaceChars() where it would go into an infinite loop (and probably also eventually run out of memory) if the replacement string contained any of the characters to be replaced. BUG=109546 Review URL: http://codereview.chromium.org/9348106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122022 0039d316-1c4b-4281-b951-d872f2087c98
* Fix AutocompleteMatch DCHECK() triggered by ↵asvitkine@chromium.org2011-11-101-8/+23
| | | | | | | | | | | | | | | | | | | |RenderViewContextMenu::AppendSearchProvider()|. Makes |AppendSearchProvider()| sanitize the text by replacing unwanted whitespace characters with spaces. Do this instead of calling |AutocompleteMatch::SanitizeString()|, since we want to preserve the whitespace between words separated by newlines here, rather than appending such words together. Added |ReplaceChars()| to base/string_util to support replacing any occurence of the given characters with a replacement string. BUG=103338 TEST=Right click on multiline text in a text area in a Debug build. A DCHECK() shouldn't trigger. Review URL: http://codereview.chromium.org/8502027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109430 0039d316-1c4b-4281-b951-d872f2087c98
* Remove an unused include.thakis@chromium.org2011-11-031-1/+0
| | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/8423068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108415 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream android string implementation etc.michaelbai@google.com2011-06-271-0/+4
| | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/7238018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90616 0039d316-1c4b-4281-b951-d872f2087c98
* Localize strings, speeds.avi@chromium.org2011-06-221-72/+22
| | | | | | | | | BUG=86527 TEST=run in non-English. For European languages, during a download the decimal separators should be commas (e.g. "0,0 MB"). (The speeds are in strings files and might take a little time to run through the translation machinery.) Review URL: http://codereview.chromium.org/7189076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90092 0039d316-1c4b-4281-b951-d872f2087c98
* Support more than 9 arguments for ReplaceStringPlaceholders()tony@chromium.org2011-06-071-2/+8
| | | | | | | | | | | | | | | | - support more than 9 arguments ($1, $2, $3, ..., $9 and $10, $11, $12, ...) for ReplaceStringPlaceholders() - add the unittest named ReplaceStringPlaceholdersMoreThan9Replacements for testing more than 9 arguments for ReplaceStringPlaceholders() BUG=16963 TEST=string_util_unittest:StringUtilTest.ReplaceStringPlaceholdersMoreThan9Replacements Patch by haraken@google.com. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82405 Review URL: http://codereview.chromium.org/6877008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88190 0039d316-1c4b-4281-b951-d872f2087c98
* wstring: remove wstring version of RemoveCharsevan@chromium.org2011-05-171-8/+0
| | | | | | | | BUG=23581 Review URL: http://codereview.chromium.org/7037014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85672 0039d316-1c4b-4281-b951-d872f2087c98
* wstring: remove wstring version of TrimWhitespaceevan@chromium.org2011-05-101-8/+0
| | | | | | | | | | And fix the one caller. BUG=23581 Review URL: http://codereview.chromium.org/6932056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84806 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 82405 - Support more than 9 arguments for ↵nsylvain@chromium.org2011-04-211-8/+2
| | | | | | | | | ReplaceStringPlaceholders()- support more than 9 arguments ($1, $2, $3, ..., $9 and $10, $11, $12, ...) for ReplaceStringPlaceholders()- add the unittest named ReplaceStringPlaceholdersMoreThan9Replacements for testing more than 9 arguments for ReplaceStringPlaceholders()BUG=16963TEST=string_util_unittest:StringUtilTest.ReplaceStringPlaceholdersMoreThan9ReplacementsPatch by haraken@google.com.Review URL: http://codereview.chromium.org/6877008 TBR=tony@chromium.org Review URL: http://codereview.chromium.org/6882108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82423 0039d316-1c4b-4281-b951-d872f2087c98
* Support more than 9 arguments for ReplaceStringPlaceholders()tony@chromium.org2011-04-201-2/+8
| | | | | | | | | | | | | | - support more than 9 arguments ($1, $2, $3, ..., $9 and $10, $11, $12, ...) for ReplaceStringPlaceholders() - add the unittest named ReplaceStringPlaceholdersMoreThan9Replacements for testing more than 9 arguments for ReplaceStringPlaceholders() BUG=16963 TEST=string_util_unittest:StringUtilTest.ReplaceStringPlaceholdersMoreThan9Replacements Patch by haraken@google.com. Review URL: http://codereview.chromium.org/6877008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82405 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Change other usages of .size() to .empty() when applicable.erg@google.com2011-03-041-1/+2
| | | | | | | | | BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6609008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76962 0039d316-1c4b-4281-b951-d872f2087c98
* Pure pedantry: Replace all ".size() == 0" with ".empty()".erg@google.com2011-03-021-1/+1
| | | | | | | | | BUG=carnitas TEST=compiles; existing unit tests. Review URL: http://codereview.chromium.org/6602049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76467 0039d316-1c4b-4281-b951-d872f2087c98
* Move ElideString() from base/string_util.cc to app/text_elider.cc to jschuh@google.com2010-12-171-37/+0
| | | | | | | | | | | | | reduce size of widely-included base libraries. Committing for tsepez. BUG=49747 TEST=TextEliderTest.* Review URL: http://codereview.chromium.org/6017001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69555 0039d316-1c4b-4281-b951-d872f2087c98
* This CL add a GetInstance() method to singleton classes instead of relying ↵satish@chromium.org2010-12-041-3/+7
| | | | | | | | | | | | | | | | | on the callers to use Singleton<T>. In some cases I have used the LazyInstance<T> pattern as that was simpler. This is a small step towards making all singleton classes use the Singleton<T> pattern within their code and not expect the callers to know about it. I have selected all files under src/app and src/base which use Singleton<T> in this CL. Once this CL goes in I'll work on the rest of the files. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5527004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68300 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move StringSplitAlongWhitespace to string_split.htfarina@chromium.org2010-11-151-57/+0
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/5004002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66181 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang build by moving ToLowerASCII into base namespace.tfarina@chromium.org2010-11-031-1/+1
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/4371001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64879 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move CaseInsensitiveCompare traits into the base namespace.tfarina@chromium.org2010-11-031-2/+2
| | | | | | | | | | | | | | | This should fix conflicts like: 2>d:\src\chromium_src2\src\base/string_util.h(480) : error C2904: 'CaseInsensitiveCompare' : name already used for a template in the current scope 2> d:\src\chromium_src2\src\third_party\xulrunner-sdk\win\include\xpcom\nsStringAPI.h(1406) : see declaration of 'CaseInsensitiveCompare' Reported-by: Jeff Timanus <twiz@google.com> BUG=None TEST=trybots Review URL: http://codereview.chromium.org/4366001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64877 0039d316-1c4b-4281-b951-d872f2087c98
* base: remove various unused string utility functionsevan@chromium.org2010-10-141-14/+0
| | | | | | | | TEST=trybots Review URL: http://codereview.chromium.org/3753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62580 0039d316-1c4b-4281-b951-d872f2087c98
* fixes issue 52839 (MatchPattern timeout)andybons@chromium.org2010-10-061-0/+4
| | | | | | | | | | | | | Fixes issue 52839 by converting consecutive wildcards (******) into one wildcard (*) in MatchPattern. BUG=52839 TEST=MatchPattern Original patch from issue 3608005 (Jon Stritar) Review URL: http://codereview.chromium.org/3551016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61644 0039d316-1c4b-4281-b951-d872f2087c98
* Add DCHECK for misused string resources.estade@chromium.org2010-10-041-5/+6
| | | | | | | | | | | When replacing a placeholder in a localized string, make sure the correct number of placeholders were found (i.e. the same number of strings that the calling code passed). BUG=none TEST=running/testing the browser in debug doesn't cause errors Review URL: http://codereview.chromium.org/3396025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61420 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented VLOG() et al.akalin@chromium.org2010-09-291-3/+4
| | | | | | | | | | | | | | Implemented VLOG(), VLOG_IF(), VLOG_IS_ON(). Added --v and --vmodule switches. Changed some spammy sync-related logs to use VLOG. BUG=56965 TEST=New unittests Review URL: http://codereview.chromium.org/3448028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60976 0039d316-1c4b-4281-b951-d872f2087c98
* base: Finish moving the SplitString functions from string_util.h to ↵tfarina@chromium.org2010-09-241-45/+0
| | | | | | | | | | | string_split.h BUG=None TEST=trybos Review URL: http://codereview.chromium.org/3447008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60422 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move SplitStringDontTrim functions from string_util.h to string_split.htfarina@chromium.org2010-09-151-20/+2
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3366011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59493 0039d316-1c4b-4281-b951-d872f2087c98
* Make the glob matcher support UTF8 strings.mnissler@chromium.org2010-09-101-41/+78
| | | | | | | | | | | This generalizes the existing pattern matching code to support UTF8 strings. BUG=53158 TEST=string_util_unittests.cc Review URL: http://codereview.chromium.org/3295018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59071 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move SplitStringUsingSubstr functions from string_util.h to string_split.htfarina@chromium.org2010-09-021-34/+0
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3284005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58300 0039d316-1c4b-4281-b951-d872f2087c98
* Add an accordian effect to NTP.aa@chromium.org2010-08-311-1/+5
| | | | | | | | BUG=53248 Review URL: http://codereview.chromium.org/3250002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57966 0039d316-1c4b-4281-b951-d872f2087c98
* Convert FormatBytes to string16.evan@chromium.org2010-08-191-23/+23
| | | | | | | | | | I considered ASCII, but it's producing what is intended to be a human-readable string. For example, in theory the "bytes/s" annotation could be localized into a language where the "b" is non-ASCII. Review URL: http://codereview.chromium.org/3107021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56771 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Convert FormatBytes to string16."evan@chromium.org2010-08-181-23/+23
| | | | | | This reverts commit r56603. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56608 0039d316-1c4b-4281-b951-d872f2087c98
* Convert FormatBytes to string16.evan@chromium.org2010-08-181-23/+23
| | | | | | | | | | I considered ASCII, but it's producing what is intended to be a human-readable string. For example, in theory the "bytes/s" annotation could be localized into a language where the "b" is non-ASCII. Review URL: http://codereview.chromium.org/3107021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56603 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringPrintf into its own file and use the base namespace. Currently ↵brettw@chromium.org2010-08-171-157/+0
| | | | | | | | | | | | | | this has using directives for the functions so I don't have to change all files to use the namespace. No code changes to logic. TEST=it compiles + the included unit tests BUG=none Review URL: http://codereview.chromium.org/3181016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56299 0039d316-1c4b-4281-b951-d872f2087c98
* Remove number conversion functions from string_util. These moved to ↵brettw@chromium.org2010-08-031-503/+0
| | | | | | | | | | string_number_conversions. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3054036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54747 0039d316-1c4b-4281-b951-d872f2087c98
* Move ASCIIToWide and ASCIIToUTF16 to utf_string_conversions.h. I've found itbrettw@chromium.org2010-07-311-10/+1
| | | | | | | | | | | | | | | | | | | | | | | weird that UTF8ToWide is in utf_string_conversions, but ASCIIToWide is in string_util.h. This should help some dependencies since string_util changes much more frequently than utf_string_conversions and fewer files will now need string_utils. Since this requires a lot of changes, this keeps a forward-declaration in string_util so I can update the entire project incrementally. This change updates base and net only. I removed some includes of string_util from header files in net. In particular, url_request_context which involved creating a new .cc file to implement a function (already virtual so there's no speed penalty). It turns out a lot of files were getting string_util from this include, so I had to update a bunch of random files to now explicitly include string_util.h TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3076013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54456 0039d316-1c4b-4281-b951-d872f2087c98
* Made changes to TruncateUtF8ToByteSize to cleanup the code. jerrica@google.com2010-06-171-4/+5
| | | | | | | | | | | I made some corrections to my previously submitted function TruncateUTF8ToByteSize, in order to clean up the code, and use it to truncate sync node titles above 255 bytes. BUG=43675 TEST=base/string_util_unittest.cc Review URL: http://codereview.chromium.org/2632005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50112 0039d316-1c4b-4281-b951-d872f2087c98
* Add Tokenize() for StringPiece.mbelshe@chromium.org2010-06-021-0/+6
| | | | | | | | | BUG=none TEST=StringUtilTest.TokenizeStringPiece Review URL: http://codereview.chromium.org/2463007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48792 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method that truncates strings to the end point of a valid UTF8 ↵nick@chromium.org2010-05-281-0/+35
| | | | | | | | | | | | | character, leaving the string's size to be less than or equal to a specified byte size. BUG=43675 TEST=base/string_util_unittest.cc Patch contributed by to Jerrica Jones (jerrica@chromium.org). Review URL: http://codereview.chromium.org/2239007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48518 0039d316-1c4b-4281-b951-d872f2087c98
* Use HttpRequestHeaders for extra_headers.willchan@chromium.org2010-04-201-14/+0
| | | | | | | | BUG=22588 Review URL: http://codereview.chromium.org/1604011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45096 0039d316-1c4b-4281-b951-d872f2087c98
* Rejigger how we format the display of bytes.evan@chromium.org2010-04-151-12/+6
| | | | | | | | | | | | | | | | | | | | | | | (Note that this does *not* touch the mega/mebi issue, despite my recent discussion of it.) What had been bugging me was that when downloading a file, you'd see it count up 10.7, 10.8, 10.9, *11*, 11.1. That is, previously when we rounded to displaying a trailing zero, we'd clip it off, which would make a download display like "11.1 / 50.2MB" jiggle to the left every time the trailing digit lined up. Now we try to always display three digits, which means we count up like 98.8, 98.9, *99.0*, 99.1, ... 99.9, 100, ... 101. This code is after fiddling the test into the shape I wanted it to be, then making the code produce that behavior. TEST=covered by unit test, updated with new expected behavior Review URL: http://codereview.chromium.org/1558025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44671 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r42300: "HttpRequestHeaders refactor."willchan@chromium.org2010-03-291-0/+48
| | | | | | | | | Adds a fix and tests for empty header values. The particular bug happened when the value was non-empty, but was all LWS, so it was effectively empty. BUG=22588 Review URL: http://codereview.chromium.org/1370001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43000 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Reland r42300: "HttpRequestHeaders refactor."""willchan@chromium.org2010-03-231-48/+0
| | | | | | | | Broke another layout test. Review URL: http://codereview.chromium.org/1223001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42387 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r42300: "HttpRequestHeaders refactor.""willchan@chromium.org2010-03-231-0/+48
| | | | | | | | | | | | This time, make sure HttpRequestHeaders::FindHeader() checks key lengths are equal. * Create HttpRequestHeaders. * Switch HttpNetworkTransaction to build request headers. TODO: Change extra_headers to use HttpRequestHeaders. BUG=22588 Review URL: http://codereview.chromium.org/1110014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42376 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r42300: "HttpRequestHeaders refactor."willchan@chromium.org2010-03-231-48/+0
| | | | | | | | | Broke access-control-basic-whitelist-request-headers.html layout test. BUG=22588 Review URL: http://codereview.chromium.org/1110012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42305 0039d316-1c4b-4281-b951-d872f2087c98
* HttpRequestHeaders refactor.willchan@chromium.org2010-03-231-0/+48
| | | | | | | | | | | * Create HttpRequestHeaders. * Switch HttpNetworkTransaction to build request headers. TODO: Change extra_headers to use HttpRequestHeaders. BUG=22588 Review URL: http://codereview.chromium.org/1039001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42300 0039d316-1c4b-4281-b951-d872f2087c98
* Make IsStringUTF8 reject (U+FDD0 .. U+FDEF) jschuh@google.com2010-02-261-132/+12
| | | | | | | | | | | Eliminated the old Mozilla implementation and used an ICU-based implementation. BUG=2759 TEST=base_unittests --gtest_filter=StringUtilTest.IsStringUTF8 Review URL: http://codereview.chromium.org/661205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40178 0039d316-1c4b-4281-b951-d872f2087c98
* This CL addresses 2 issues:jcampan@chromium.org2010-02-101-0/+26
| | | | | | | | | | | | | | | | - we were not computing the max request text size correctly in some cases (by forgetting the size of the &q= string) causing assertions. - the translate server might send inconsistent response in some cases, this CL makes sure we deal with them. A common case is when sending separators only strings, which we are not doing now anymore. Other more complicated case are less clear. BUG=35055 TEST=Visit www.spiegel.de and translate the page. The page should be translated correctly. Review URL: http://codereview.chromium.org/594023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38637 0039d316-1c4b-4281-b951-d872f2087c98
* linux: build with -Wextraevan@chromium.org2010-02-051-1/+19
| | | | | | | | | | | | 95% of this is removing "const" from return types, but turning this on found one bug! (A "for" loop that expected its iterator to go negative but which was using an unsigned type.) BUG=34160 Review URL: http://codereview.chromium.org/570012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38266 0039d316-1c4b-4281-b951-d872f2087c98
* Implement RemoveChars, a function to remove a list of characters from a ↵jhawkins@chromium.org2010-02-051-0/+39
| | | | | | | | | | string, and use it in PhoneNumber to remove extra phone number characters. BUG=none TEST=StringUtilTest.RemoveChars Review URL: http://codereview.chromium.org/572015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38162 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 36459 - Breaks 7 WebKit testsjschuh@chromium.org2010-01-161-12/+131
| | | | | | | | | | | | | | | | | | | | | | Changes are: * base::IsValidCodepoint() now returns false on noncharacter code points. * base::IsStringUTF8() now uses ICU library (removed old Mozilla implementation). * Removed base::IsStringWideUTF8() (was unused and confusing) * file_util::ReplaceIllegalCharactersInPath() now treats Unicode replacement character (U+FFFD) as invalid. * Associated unit tests updated. BUG=2759 BUG=30662 TEST=base_unittests gtest_filter=StringUtilTest.IsStringUTF8 TEST=base_unittests gtest_filter=UTFStringConversionsTest.* TEST=base_unittests gtest_filter=FileUtilICUTestReplaceIllegalCharactersInPathTest Review URL: http://codereview.chromium.org/548017 TBR=jschuh@chromium.org Review URL: http://codereview.chromium.org/552026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36460 0039d316-1c4b-4281-b951-d872f2087c98
* Changes are:jschuh@chromium.org2010-01-161-131/+12
| | | | | | | | | | | | | | | | | * base::IsValidCodepoint() now returns false on non-character code points. * base::IsStringUTF8() now uses ICU library (removed old Mozilla implementation). * Removed base::IsStringWideUTF8() (was unused and confusing) * file_util::ReplaceIllegalCharactersInPath() now treats Unicode replacement character (U+FFFD) as invalid. * Associated unit tests updated. BUG=2759 BUG=30662 TEST=base_unittests --gtest_filter=StringUtilTest.IsStringUTF8 TEST=base_unittests --gtest_filter=UTFStringConversionsTest.* TEST=base_unittests --gtest_filter=FileUtilICUTestReplaceIllegalCharactersInPathTest Review URL: http://codereview.chromium.org/548017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36459 0039d316-1c4b-4281-b951-d872f2087c98
* This CL contains the back-end implementation of the translate feature. It ↵jcampan@chromium.org2010-01-141-0/+16
| | | | | | | | | | | | | adds a Translate method to the renderer. On invocation this method triggers a traversal of the DOM page to retrieve the text nodes. The text node contents are then sent to the browser for actual translation (at this point, we just up-case the text for testing purpose). The browser sends back the translated text to the renderer that replace the DOM text node values with the translated text. BUG=None TEST=Run the unit-tests. Review URL: http://codereview.chromium.org/547013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36258 0039d316-1c4b-4281-b951-d872f2087c98