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

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

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « pdf/pdfium/pdfium_engine.cc ('k') | remoting/host/token_validator_factory_impl.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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 base::Value* PDFiumPage::GetTextBoxAsValue(double page_height, 151 base::Value* PDFiumPage::GetTextBoxAsValue(double page_height,
152 double left, double top, 152 double left, double top,
153 double right, double bottom, 153 double right, double bottom,
154 int rotation) { 154 int rotation) {
155 base::string16 text_utf16; 155 base::string16 text_utf16;
156 int char_count = 156 int char_count =
157 FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, NULL, 0); 157 FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, NULL, 0);
158 if (char_count > 0) { 158 if (char_count > 0) {
159 unsigned short* data = reinterpret_cast<unsigned short*>( 159 unsigned short* data = reinterpret_cast<unsigned short*>(
160 WriteInto(&text_utf16, char_count + 1)); 160 base::WriteInto(&text_utf16, char_count + 1));
161 FPDFText_GetBoundedText(GetTextPage(), 161 FPDFText_GetBoundedText(GetTextPage(),
162 left, top, right, bottom, 162 left, top, right, bottom,
163 data, char_count); 163 data, char_count);
164 } 164 }
165 std::string text_utf8 = base::UTF16ToUTF8(text_utf16); 165 std::string text_utf8 = base::UTF16ToUTF8(text_utf16);
166 166
167 FPDF_LINK link = FPDFLink_GetLinkAtPoint(GetPage(), left, top); 167 FPDF_LINK link = FPDFLink_GetLinkAtPoint(GetPage(), left, top);
168 Area area; 168 Area area;
169 std::vector<LinkTarget> targets; 169 std::vector<LinkTarget> targets;
170 if (link) { 170 if (link) {
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 page_->loading_count_--; 508 page_->loading_count_--;
509 } 509 }
510 510
511 PDFiumPage::Link::Link() { 511 PDFiumPage::Link::Link() {
512 } 512 }
513 513
514 PDFiumPage::Link::~Link() { 514 PDFiumPage::Link::~Link() {
515 } 515 }
516 516
517 } // namespace chrome_pdf 517 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_engine.cc ('k') | remoting/host/token_validator_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698