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

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

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « printing/backend/cups_helper.cc ('k') | printing/emf_win_unittest.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/print_backend.h" 5 #include "printing/backend/print_backend.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 base::FilePath ppd_path(GetPPD(printer_name.c_str())); 245 base::FilePath ppd_path(GetPPD(printer_name.c_str()));
246 // In some cases CUPS failed to get ppd file. 246 // In some cases CUPS failed to get ppd file.
247 if (ppd_path.empty()) { 247 if (ppd_path.empty()) {
248 LOG(ERROR) << "CUPS: Failed to get PPD" 248 LOG(ERROR) << "CUPS: Failed to get PPD"
249 << ", printer name: " << printer_name; 249 << ", printer name: " << printer_name;
250 return false; 250 return false;
251 } 251 }
252 252
253 std::string content; 253 std::string content;
254 bool res = file_util::ReadFileToString(ppd_path, &content); 254 bool res = base::ReadFileToString(ppd_path, &content);
255 255
256 base::DeleteFile(ppd_path, false); 256 base::DeleteFile(ppd_path, false);
257 257
258 if (res) { 258 if (res) {
259 printer_info->printer_capabilities.swap(content); 259 printer_info->printer_capabilities.swap(content);
260 printer_info->caps_mime_type = "application/pagemaker"; 260 printer_info->caps_mime_type = "application/pagemaker";
261 // In CUPS, printer defaults is a part of PPD file. Nothing to upload here. 261 // In CUPS, printer defaults is a part of PPD file. Nothing to upload here.
262 printer_info->printer_defaults.clear(); 262 printer_info->printer_defaults.clear();
263 printer_info->defaults_mime_type.clear(); 263 printer_info->defaults_mime_type.clear();
264 } 264 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 << ", HTTP error: " << http_error; 377 << ", HTTP error: " << http_error;
378 base::DeleteFile(ppd_path, false); 378 base::DeleteFile(ppd_path, false);
379 ppd_path.clear(); 379 ppd_path.clear();
380 } 380 }
381 } 381 }
382 } 382 }
383 return ppd_path; 383 return ppd_path;
384 } 384 }
385 385
386 } // namespace printing 386 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/cups_helper.cc ('k') | printing/emf_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698