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

Side by Side Diff: pdf/pdfium/pdfium_page.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « pdf/document_loader.cc ('k') | ppapi/proxy/file_chooser_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "pdf/pdfium/pdfium_page.h" 5 #include "pdf/pdfium/pdfium_page.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Remove the extra NULL character at end. 182 // Remove the extra NULL character at end.
183 // Otherwise, find() will not return any matches. 183 // Otherwise, find() will not return any matches.
184 if (targets[i].url.size() > 0 && 184 if (targets[i].url.size() > 0 &&
185 targets[i].url[targets[i].url.size() - 1] == '\0') { 185 targets[i].url[targets[i].url.size() - 1] == '\0') {
186 targets[i].url.resize(targets[i].url.size() - 1); 186 targets[i].url.resize(targets[i].url.size() - 1);
187 } 187 }
188 // There should only ever be one NULL character 188 // There should only ever be one NULL character
189 DCHECK(targets[i].url[targets[i].url.size() - 1] != '\0'); 189 DCHECK(targets[i].url[targets[i].url.size() - 1] != '\0');
190 190
191 // PDFium may change the case of generated links. 191 // PDFium may change the case of generated links.
192 std::string lowerCaseURL = StringToLowerASCII(targets[i].url); 192 std::string lowerCaseURL = base::StringToLowerASCII(targets[i].url);
193 std::string lowerCaseText = StringToLowerASCII(text_utf8); 193 std::string lowerCaseText = base::StringToLowerASCII(text_utf8);
194 size_t pos = lowerCaseText.find(lowerCaseURL, start); 194 size_t pos = lowerCaseText.find(lowerCaseURL, start);
195 size_t length = targets[i].url.size(); 195 size_t length = targets[i].url.size();
196 if (pos == std::string::npos) { 196 if (pos == std::string::npos) {
197 // Check if the link is a "mailto:" URL 197 // Check if the link is a "mailto:" URL
198 if (lowerCaseURL.compare(0, 7, "mailto:") == 0) { 198 if (lowerCaseURL.compare(0, 7, "mailto:") == 0) {
199 pos = lowerCaseText.find(lowerCaseURL.substr(7), start); 199 pos = lowerCaseText.find(lowerCaseURL.substr(7), start);
200 length -= 7; 200 length -= 7;
201 } 201 }
202 202
203 if (pos == std::string::npos) { 203 if (pos == std::string::npos) {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 new_left, new_top, new_right - new_left + 1, new_bottom - new_top + 1); 469 new_left, new_top, new_right - new_left + 1, new_bottom - new_top + 1);
470 } 470 }
471 471
472 PDFiumPage::Link::Link() { 472 PDFiumPage::Link::Link() {
473 } 473 }
474 474
475 PDFiumPage::Link::~Link() { 475 PDFiumPage::Link::~Link() {
476 } 476 }
477 477
478 } // namespace chrome_pdf 478 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/document_loader.cc ('k') | ppapi/proxy/file_chooser_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698