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

Side by Side Diff: content/renderer/android/address_detector.cc

Issue 121033002: Update uses of UTF conversions in content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/android/address_detector.h" 5 #include "content/renderer/android/address_detector.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 23 matching lines...) Expand all
34 34
35 size_t AddressDetector::GetMaximumContentLength() { 35 size_t AddressDetector::GetMaximumContentLength() {
36 return kMaxAddressLength; 36 return kMaxAddressLength;
37 } 37 }
38 38
39 std::string AddressDetector::GetContentText(const base::string16& text) { 39 std::string AddressDetector::GetContentText(const base::string16& text) {
40 // Get the address and replace unicode bullets with commas. 40 // Get the address and replace unicode bullets with commas.
41 base::string16 address_16 = CollapseWhitespace(text, false); 41 base::string16 address_16 = CollapseWhitespace(text, false);
42 std::replace(address_16.begin(), address_16.end(), 42 std::replace(address_16.begin(), address_16.end(),
43 static_cast<char16>(0x2022), static_cast<char16>(',')); 43 static_cast<char16>(0x2022), static_cast<char16>(','));
44 return UTF16ToUTF8(address_16); 44 return base::UTF16ToUTF8(address_16);
45 } 45 }
46 46
47 bool AddressDetector::FindContent( 47 bool AddressDetector::FindContent(
48 const base::string16::const_iterator& begin, 48 const base::string16::const_iterator& begin,
49 const base::string16::const_iterator& end, 49 const base::string16::const_iterator& end,
50 size_t* start_pos, 50 size_t* start_pos,
51 size_t* end_pos, 51 size_t* end_pos,
52 std::string* content_text) { 52 std::string* content_text) {
53 if (address_parser::FindAddress(begin, end, start_pos, end_pos)) { 53 if (address_parser::FindAddress(begin, end, start_pos, end_pos)) {
54 content_text->assign( 54 content_text->assign(
55 GetContentText(base::string16(begin + *start_pos, begin + *end_pos))); 55 GetContentText(base::string16(begin + *start_pos, begin + *end_pos)));
56 return true; 56 return true;
57 } 57 }
58 return false; 58 return false;
59 } 59 }
60 60
61 } // namespace content 61 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/accessibility/accessibility_node_serializer.cc ('k') | content/renderer/android/email_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698