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

Unified Diff: printing/printing_context_win.cc

Issue 3292019: Printing: Convert several wstrings to string16. (Closed)
Patch Set: Review fixes. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/printing_context_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_win.cc
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 188f031d00f840f301af3567ddaa17d3f0cd08d8..ef078330807f2bd463126d5cfd5153890f3ca5ae 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -11,6 +11,7 @@
#include "base/i18n/time_formatting.h"
#include "base/message_loop.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "printing/printed_document.h"
#include "skia/ext/platform_device_win.h"
@@ -246,7 +247,7 @@ void PrintingContext::ResetSettings() {
}
PrintingContext::Result PrintingContext::NewDocument(
- const std::wstring& document_name) {
+ const string16& document_name) {
DCHECK(!in_print_job_);
if (!context_)
return OnError();
@@ -261,10 +262,10 @@ PrintingContext::Result PrintingContext::NewDocument(
return OnError();
DOCINFO di = { sizeof(DOCINFO) };
- di.lpszDocName = document_name.c_str();
+ di.lpszDocName = UTF16ToWide(document_name).c_str();
// Is there a debug dump directory specified? If so, force to print to a file.
- std::wstring debug_dump_path = PrintedDocument::debug_dump_path();
+ FilePath debug_dump_path = PrintedDocument::debug_dump_path();
if (!debug_dump_path.empty()) {
// Create a filename.
std::wstring filename;
@@ -273,12 +274,12 @@ PrintingContext::Result PrintingContext::NewDocument(
filename += L"_";
filename += base::TimeFormatTimeOfDay(now);
filename += L"_";
- filename += document_name;
+ filename += UTF16ToWide(document_name);
filename += L"_";
filename += L"buffer.prn";
file_util::ReplaceIllegalCharactersInPath(&filename, '_');
- file_util::AppendToPath(&debug_dump_path, filename);
- di.lpszOutput = debug_dump_path.c_str();
+ debug_dump_path.Append(filename);
+ di.lpszOutput = debug_dump_path.value().c_str();
}
// No message loop running in unit tests.
« no previous file with comments | « printing/printing_context_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698