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

Side by Side Diff: printing/backend/cups_helper.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | printing/backend/print_backend_cups.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) 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 "printing/backend/cups_helper.h" 5 #include "printing/backend/cups_helper.h"
6 6
7 #include <cups/ppd.h> 7 #include <cups/ppd.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 PrinterSemanticCapsAndDefaults* printer_info) { 343 PrinterSemanticCapsAndDefaults* printer_info) {
344 base::FilePath ppd_file_path; 344 base::FilePath ppd_file_path;
345 if (!file_util::CreateTemporaryFile(&ppd_file_path)) 345 if (!file_util::CreateTemporaryFile(&ppd_file_path))
346 return false; 346 return false;
347 347
348 int data_size = printer_capabilities.length(); 348 int data_size = printer_capabilities.length();
349 if (data_size != file_util::WriteFile( 349 if (data_size != file_util::WriteFile(
350 ppd_file_path, 350 ppd_file_path,
351 printer_capabilities.data(), 351 printer_capabilities.data(),
352 data_size)) { 352 data_size)) {
353 file_util::Delete(ppd_file_path, false); 353 base::Delete(ppd_file_path, false);
354 return false; 354 return false;
355 } 355 }
356 356
357 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str()); 357 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str());
358 if (!ppd) 358 if (!ppd)
359 return false; 359 return false;
360 360
361 printing::PrinterSemanticCapsAndDefaults caps; 361 printing::PrinterSemanticCapsAndDefaults caps;
362 #if !defined(OS_MACOSX) 362 #if !defined(OS_MACOSX)
363 MarkLpOptions(printer_name, &ppd); 363 MarkLpOptions(printer_name, &ppd);
(...skipping 16 matching lines...) Expand all
380 bool is_color = false; 380 bool is_color = false;
381 int cm_color = 0, cm_black = 0; 381 int cm_color = 0, cm_black = 0;
382 if (!GetColorModelSettings(ppd, &cm_black, &cm_color, &is_color)) { 382 if (!GetColorModelSettings(ppd, &cm_black, &cm_color, &is_color)) {
383 VLOG(1) << "Unknown printer color model"; 383 VLOG(1) << "Unknown printer color model";
384 } 384 }
385 385
386 caps.color_changeable = (cm_color && cm_black && (cm_color != cm_black)); 386 caps.color_changeable = (cm_color && cm_black && (cm_color != cm_black));
387 caps.color_default = is_color; 387 caps.color_default = is_color;
388 388
389 ppdClose(ppd); 389 ppdClose(ppd);
390 file_util::Delete(ppd_file_path, false); 390 base::Delete(ppd_file_path, false);
391 391
392 *printer_info = caps; 392 *printer_info = caps;
393 return true; 393 return true;
394 } 394 }
395 395
396 } // namespace printing 396 } // namespace printing
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | printing/backend/print_backend_cups.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698