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

Side by Side Diff: chrome/renderer/mock_printer.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 "chrome/renderer/mock_printer.h" 5 #include "chrome/renderer/mock_printer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 *checksum = pages_[page]->image().checksum(); 266 *checksum = pages_[page]->image().checksum();
267 return true; 267 return true;
268 } 268 }
269 269
270 bool MockPrinter::SaveSource( 270 bool MockPrinter::SaveSource(
271 unsigned int page, const base::FilePath& filepath) const { 271 unsigned int page, const base::FilePath& filepath) const {
272 if (printer_status_ != PRINTER_READY || page >= pages_.size()) 272 if (printer_status_ != PRINTER_READY || page >= pages_.size())
273 return false; 273 return false;
274 const uint8* source_data = pages_[page]->source_data(); 274 const uint8* source_data = pages_[page]->source_data();
275 uint32 source_size = pages_[page]->source_size(); 275 uint32 source_size = pages_[page]->source_size();
276 file_util::WriteFile(filepath, reinterpret_cast<const char*>(source_data), 276 base::WriteFile(filepath, reinterpret_cast<const char*>(source_data),
277 source_size); 277 source_size);
278 return true; 278 return true;
279 } 279 }
280 280
281 bool MockPrinter::SaveBitmap( 281 bool MockPrinter::SaveBitmap(
282 unsigned int page, const base::FilePath& filepath) const { 282 unsigned int page, const base::FilePath& filepath) const {
283 if (printer_status_ != PRINTER_READY || page >= pages_.size()) 283 if (printer_status_ != PRINTER_READY || page >= pages_.size())
284 return false; 284 return false;
285 285
286 pages_[page]->image().SaveToPng(filepath); 286 pages_[page]->image().SaveToPng(filepath);
287 return true; 287 return true;
(...skipping 17 matching lines...) Expand all
305 params->margin_left = margin_left_; 305 params->margin_left = margin_left_;
306 params->margin_top = margin_top_; 306 params->margin_top = margin_top_;
307 params->is_first_request = is_first_request_; 307 params->is_first_request = is_first_request_;
308 params->print_scaling_option = print_scaling_option_; 308 params->print_scaling_option = print_scaling_option_;
309 params->print_to_pdf = print_to_pdf_; 309 params->print_to_pdf = print_to_pdf_;
310 params->preview_request_id = preview_request_id_; 310 params->preview_request_id = preview_request_id_;
311 params->display_header_footer = display_header_footer_; 311 params->display_header_footer = display_header_footer_;
312 params->title = title_; 312 params->title = title_;
313 params->url = url_; 313 params->url = url_;
314 } 314 }
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util_unittest.cc ('k') | chrome/service/cloud_print/connector_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698