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

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

Issue 93263002: Move some more file utils to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/socket/unix_domain_socket_posix_unittest.cc ('k') | remoting/host/branding.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 cups_option_t* options = NULL; 92 cups_option_t* options = NULL;
93 int num_options = 0; 93 int num_options = 0;
94 ppdMarkDefaults(*ppd); 94 ppdMarkDefaults(*ppd);
95 95
96 const char kSystemLpOptionPath[] = "/etc/cups/lpoptions"; 96 const char kSystemLpOptionPath[] = "/etc/cups/lpoptions";
97 const char kUserLpOptionPath[] = ".cups/lpoptions"; 97 const char kUserLpOptionPath[] = ".cups/lpoptions";
98 98
99 std::vector<base::FilePath> file_locations; 99 std::vector<base::FilePath> file_locations;
100 file_locations.push_back(base::FilePath(kSystemLpOptionPath)); 100 file_locations.push_back(base::FilePath(kSystemLpOptionPath));
101 file_locations.push_back(base::FilePath( 101 file_locations.push_back(base::FilePath(
102 file_util::GetHomeDir().Append(kUserLpOptionPath))); 102 base::GetHomeDir().Append(kUserLpOptionPath)));
103 103
104 for (std::vector<base::FilePath>::const_iterator it = file_locations.begin(); 104 for (std::vector<base::FilePath>::const_iterator it = file_locations.begin();
105 it != file_locations.end(); ++it) { 105 it != file_locations.end(); ++it) {
106 num_options = 0; 106 num_options = 0;
107 options = NULL; 107 options = NULL;
108 ParseLpOptions(*it, printer_name, &num_options, &options); 108 ParseLpOptions(*it, printer_name, &num_options, &options);
109 if (num_options > 0 && options) { 109 if (num_options > 0 && options) {
110 cupsMarkOptions(*ppd, num_options, options); 110 cupsMarkOptions(*ppd, num_options, options);
111 cupsFreeOptions(num_options, options); 111 cupsFreeOptions(num_options, options);
112 } 112 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 caps.bw_model = cm_black; 390 caps.bw_model = cm_black;
391 391
392 ppdClose(ppd); 392 ppdClose(ppd);
393 base::DeleteFile(ppd_file_path, false); 393 base::DeleteFile(ppd_file_path, false);
394 394
395 *printer_info = caps; 395 *printer_info = caps;
396 return true; 396 return true;
397 } 397 }
398 398
399 } // namespace printing 399 } // namespace printing
OLDNEW
« no previous file with comments | « net/socket/unix_domain_socket_posix_unittest.cc ('k') | remoting/host/branding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698