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

Side by Side Diff: printing/backend/cups_helper.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 | « 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 17 matching lines...) Expand all
28 const char kHighGray[] = "High.Gray"; 28 const char kHighGray[] = "High.Gray";
29 29
30 const char kDuplex[] = "Duplex"; 30 const char kDuplex[] = "Duplex";
31 const char kDuplexNone[] = "None"; 31 const char kDuplexNone[] = "None";
32 32
33 #if !defined(OS_MACOSX) 33 #if !defined(OS_MACOSX)
34 void ParseLpOptions(const base::FilePath& filepath, 34 void ParseLpOptions(const base::FilePath& filepath,
35 const std::string& printer_name, 35 const std::string& printer_name,
36 int* num_options, cups_option_t** options) { 36 int* num_options, cups_option_t** options) {
37 std::string content; 37 std::string content;
38 if (!file_util::ReadFileToString(filepath, &content)) 38 if (!base::ReadFileToString(filepath, &content))
39 return; 39 return;
40 40
41 const char kDest[] = "dest"; 41 const char kDest[] = "dest";
42 const char kDefault[] = "default"; 42 const char kDefault[] = "default";
43 const size_t kDestLen = sizeof(kDest) - 1; 43 const size_t kDestLen = sizeof(kDest) - 1;
44 const size_t kDefaultLen = sizeof(kDefault) - 1; 44 const size_t kDefaultLen = sizeof(kDefault) - 1;
45 std::vector<std::string> lines; 45 std::vector<std::string> lines;
46 base::SplitString(content, '\n', &lines); 46 base::SplitString(content, '\n', &lines);
47 47
48 for (size_t i = 0; i < lines.size(); ++i) { 48 for (size_t i = 0; i < lines.size(); ++i) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 caps.color_default = is_color; 387 caps.color_default = is_color;
388 388
389 ppdClose(ppd); 389 ppdClose(ppd);
390 base::DeleteFile(ppd_file_path, false); 390 base::DeleteFile(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