diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 05:15:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 05:15:45 +0000 |
commit | 79f6388902881a0aab426e9606c544b68ab3b9bc (patch) | |
tree | df8da7e82fded47bccf4fe32922a8451a475bf97 /printing | |
parent | 6d4b67a4b50d73d5001aec99014ac40bc504871a (diff) | |
download | chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.zip chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.tar.gz chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.tar.bz2 |
Replace FilePath with base::FilePath in some more top level directories.
Review URL: https://codereview.chromium.org/12217101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/backend/cups_helper.cc | 13 | ||||
-rw-r--r-- | printing/backend/print_backend_cups.cc | 10 | ||||
-rw-r--r-- | printing/backend/win_helper.cc | 2 | ||||
-rw-r--r-- | printing/emf_win.cc | 6 | ||||
-rw-r--r-- | printing/emf_win_unittest.cc | 4 | ||||
-rw-r--r-- | printing/image.cc | 4 | ||||
-rw-r--r-- | printing/pdf_metafile_cg_mac.cc | 2 | ||||
-rw-r--r-- | printing/pdf_metafile_skia.cc | 2 | ||||
-rw-r--r-- | printing/printed_document.cc | 7 | ||||
-rw-r--r-- | printing/printing_context_win.cc | 2 |
10 files changed, 27 insertions, 25 deletions
diff --git a/printing/backend/cups_helper.cc b/printing/backend/cups_helper.cc index 5b500e7..14ae2d5 100644 --- a/printing/backend/cups_helper.cc +++ b/printing/backend/cups_helper.cc @@ -31,7 +31,8 @@ const char kDuplex[] = "Duplex"; const char kDuplexNone[] = "None"; #if !defined(OS_MACOSX) -void ParseLpOptions(const FilePath& filepath, const std::string& printer_name, +void ParseLpOptions(const base::FilePath& filepath, + const std::string& printer_name, int* num_options, cups_option_t** options) { std::string content; if (!file_util::ReadFileToString(filepath, &content)) @@ -93,12 +94,12 @@ void MarkLpOptions(const std::string& printer_name, ppd_file_t** ppd) { const char kSystemLpOptionPath[] = "/etc/cups/lpoptions"; const char kUserLpOptionPath[] = ".cups/lpoptions"; - std::vector<FilePath> file_locations; - file_locations.push_back(FilePath(kSystemLpOptionPath)); - file_locations.push_back(FilePath( + std::vector<base::FilePath> file_locations; + file_locations.push_back(base::FilePath(kSystemLpOptionPath)); + file_locations.push_back(base::FilePath( file_util::GetHomeDir().Append(kUserLpOptionPath))); - for (std::vector<FilePath>::const_iterator it = file_locations.begin(); + for (std::vector<base::FilePath>::const_iterator it = file_locations.begin(); it != file_locations.end(); ++it) { num_options = 0; options = NULL; @@ -340,7 +341,7 @@ bool parsePpdCapabilities( const std::string& printer_name, const std::string& printer_capabilities, PrinterSemanticCapsAndDefaults* printer_info) { - FilePath ppd_file_path; + base::FilePath ppd_file_path; if (!file_util::CreateTemporaryFile(&ppd_file_path)) return false; diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc index c2f236b..bd51130 100644 --- a/printing/backend/print_backend_cups.cc +++ b/printing/backend/print_backend_cups.cc @@ -128,7 +128,7 @@ class PrintBackendCUPS : public PrintBackend { // version in another case. There is an issue specifing CUPS_HTTP_DEFAULT // in the <functions>2(), it does not work in CUPS prior to 1.4. int GetDests(cups_dest_t** dests); - FilePath GetPPD(const char* name); + base::FilePath GetPPD(const char* name); GURL print_server_url_; http_encryption_t cups_encryption_; @@ -235,7 +235,7 @@ bool PrintBackendCUPS::GetPrinterCapsAndDefaults( VLOG(1) << "CUPS: Getting caps and defaults" << ", printer name: " << printer_name; - FilePath ppd_path(GetPPD(printer_name.c_str())); + base::FilePath ppd_path(GetPPD(printer_name.c_str())); // In some cases CUPS failed to get ppd file. if (ppd_path.empty()) { LOG(ERROR) << "CUPS: Failed to get PPD" @@ -332,12 +332,12 @@ FilePath PrintBackendCUPS::GetPPD(const char* name) { // Protect this code with lock. CR_DEFINE_STATIC_LOCAL(base::Lock, ppd_lock, ()); base::AutoLock ppd_autolock(ppd_lock); - FilePath ppd_path; + base::FilePath ppd_path; const char* ppd_file_path = NULL; if (print_server_url_.is_empty()) { // Use default (local) print server. ppd_file_path = cupsGetPPD(name); if (ppd_file_path) - ppd_path = FilePath(ppd_file_path); + ppd_path = base::FilePath(ppd_file_path); } else { // cupsGetPPD2 gets stuck sometimes in an infinite time due to network // configuration/issues. To prevent that, use non-blocking http connection @@ -360,7 +360,7 @@ FilePath PrintBackendCUPS::GetPPD(const char* name) { // Comparing file size against that content length might be unreliable // since some http reponses are encoded and content_length > file size. // Let's just check for the obvious CUPS and http errors here. - ppd_path = FilePath(ppd_file_path); + ppd_path = base::FilePath(ppd_file_path); ipp_status_t error_code = cupsLastError(); int http_error = httpError(http.http()); if (error_code > IPP_OK_EVENTS_COMPLETE || http_error != 0) { diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index fe4bacd..b3b6724 100644 --- a/printing/backend/win_helper.cc +++ b/printing/backend/win_helper.cc @@ -324,7 +324,7 @@ std::string GetDriverInfo(HANDLE printer) { if (info_6.get()->pDriverPath) { scoped_ptr<FileVersionInfo> version_info( FileVersionInfo::CreateFileVersionInfo( - FilePath(info_6.get()->pDriverPath))); + base::FilePath(info_6.get()->pDriverPath))); if (version_info.get()) { info[1] = WideToUTF8(version_info->file_version()); info[2] = WideToUTF8(version_info->product_name()); diff --git a/printing/emf_win.cc b/printing/emf_win.cc index a6005dc..6617deb 100644 --- a/printing/emf_win.cc +++ b/printing/emf_win.cc @@ -173,14 +173,14 @@ Emf::~Emf() { DeleteEnhMetaFile(emf_); } -bool Emf::InitToFile(const FilePath& metafile_path) { +bool Emf::InitToFile(const base::FilePath& metafile_path) { DCHECK(!emf_ && !hdc_); hdc_ = CreateEnhMetaFile(NULL, metafile_path.value().c_str(), NULL, NULL); DCHECK(hdc_); return hdc_ != NULL; } -bool Emf::InitFromFile(const FilePath& metafile_path) { +bool Emf::InitFromFile(const base::FilePath& metafile_path) { DCHECK(!emf_ && !hdc_); emf_ = GetEnhMetaFile(metafile_path.value().c_str()); DCHECK(emf_); @@ -277,7 +277,7 @@ bool Emf::GetDataAsVector(std::vector<uint8>* buffer) const { return true; } -bool Emf::SaveTo(const FilePath& file_path) const { +bool Emf::SaveTo(const base::FilePath& file_path) const { HANDLE file = CreateFile(file_path.value().c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL); diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc index 2da118c..bb3164d 100644 --- a/printing/emf_win_unittest.cc +++ b/printing/emf_win_unittest.cc @@ -86,7 +86,7 @@ TEST_F(EmfPrintingTest, Enumerate) { scoped_ptr<PrintingContext> context(PrintingContext::Create(std::string())); EXPECT_EQ(context->InitWithSettings(settings), PrintingContext::OK); - FilePath emf_file; + base::FilePath emf_file; EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &emf_file)); emf_file = emf_file.Append(FILE_PATH_LITERAL("printing")) .Append(FILE_PATH_LITERAL("test")) @@ -171,7 +171,7 @@ TEST(EmfTest, FileBackedEmf) { // Simplest use case. base::ScopedTempDir scratch_metafile_dir; ASSERT_TRUE(scratch_metafile_dir.CreateUniqueTempDir()); - FilePath metafile_path; + base::FilePath metafile_path; EXPECT_TRUE(file_util::CreateTemporaryFileInDir(scratch_metafile_dir.path(), &metafile_path)); uint32 size; diff --git a/printing/image.cc b/printing/image.cc index cded369..099fcd7 100644 --- a/printing/image.cc +++ b/printing/image.cc @@ -17,7 +17,7 @@ namespace printing { -Image::Image(const FilePath& path) +Image::Image(const base::FilePath& path) : row_length_(0), ignore_alpha_(true) { std::string data; @@ -58,7 +58,7 @@ std::string Image::checksum() const { return base::HexEncode(&digest, sizeof(digest)); } -bool Image::SaveToPng(const FilePath& filepath) const { +bool Image::SaveToPng(const base::FilePath& filepath) const { DCHECK(!data_.empty()); std::vector<unsigned char> compressed; bool success = gfx::PNGCodec::Encode(&*data_.begin(), diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc index d484ec9..6090809 100644 --- a/printing/pdf_metafile_cg_mac.cc +++ b/printing/pdf_metafile_cg_mac.cc @@ -286,7 +286,7 @@ bool PdfMetafileCg::GetData(void* dst_buffer, uint32 dst_buffer_size) const { return true; } -bool PdfMetafileCg::SaveTo(const FilePath& file_path) const { +bool PdfMetafileCg::SaveTo(const base::FilePath& file_path) const { DCHECK(pdf_data_.get()); DCHECK(!context_.get()); diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc index fd02ec4..e4027ed 100644 --- a/printing/pdf_metafile_skia.cc +++ b/printing/pdf_metafile_skia.cc @@ -124,7 +124,7 @@ bool PdfMetafileSkia::GetData(void* dst_buffer, return true; } -bool PdfMetafileSkia::SaveTo(const FilePath& file_path) const { +bool PdfMetafileSkia::SaveTo(const base::FilePath& file_path) const { DCHECK_GT(data_->pdf_stream_.getOffset(), 0U); SkAutoDataUnref data(data_->pdf_stream_.copyToData()); if (file_util::WriteFile(file_path, diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 7686055..32a8809 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -34,7 +34,7 @@ struct PrintDebugDumpPath { } bool enabled; - FilePath debug_dump_path; + base::FilePath debug_dump_path; }; base::LazyInstance<PrintDebugDumpPath> g_debug_dump_info = @@ -191,12 +191,13 @@ void PrintedDocument::DebugDump(const PrintedPage& page) { #endif // OS_WIN } -void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { +void PrintedDocument::set_debug_dump_path( + const base::FilePath& debug_dump_path) { g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); g_debug_dump_info.Get().debug_dump_path = debug_dump_path; } -const FilePath& PrintedDocument::debug_dump_path() { +const base::FilePath& PrintedDocument::debug_dump_path() { return g_debug_dump_info.Get().debug_dump_path; } diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 96e3572..c60c7b8 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc @@ -460,7 +460,7 @@ PrintingContext::Result PrintingContextWin::NewDocument( di.lpszDocName = document_name_wide.c_str(); // Is there a debug dump directory specified? If so, force to print to a file. - FilePath debug_dump_path = PrintedDocument::debug_dump_path(); + base::FilePath debug_dump_path = PrintedDocument::debug_dump_path(); if (!debug_dump_path.empty()) { // Create a filename. std::wstring filename; |