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

Unified Diff: printing/printing_context_win.cc

Issue 329683002: Improvements in --debug-print switch implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 06/12/2014 2:53:06.07 Created 6 years, 6 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.cc ('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 f68482d3a61016d2cd7f4a62bba3d323e287ca0c..6d81cd9c94822fbefbcf0203dd7775f8ddf2dc0e 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -8,12 +8,9 @@
#include <algorithm>
-#include "base/i18n/file_util_icu.h"
-#include "base/i18n/time_formatting.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/time/time.h"
#include "base/values.h"
#include "printing/backend/print_backend.h"
#include "printing/backend/printing_info_win.h"
@@ -31,8 +28,6 @@
#include "ui/aura/window_event_dispatcher.h"
#endif
-using base::Time;
-
namespace {
HWND GetRootWindow(gfx::NativeView view) {
@@ -408,22 +403,11 @@ PrintingContext::Result PrintingContextWin::NewDocument(
di.lpszDocName = document_name.c_str();
// Is there a debug dump directory specified? If so, force to print to a file.
- base::FilePath debug_dump_path = PrintedDocument::debug_dump_path();
- if (!debug_dump_path.empty()) {
- // Create a filename.
- std::wstring filename;
- Time now(Time::Now());
- filename = base::TimeFormatShortDateNumeric(now);
- filename += L"_";
- filename += base::TimeFormatTimeOfDay(now);
- filename += L"_";
- filename += document_name;
- filename += L"_";
- filename += L"buffer.prn";
- file_util::ReplaceIllegalCharactersInPath(&filename, '_');
- debug_dump_path = debug_dump_path.Append(filename);
- di.lpszOutput = debug_dump_path.value().c_str();
- }
+ base::string16 debug_dump_path =
+ PrintedDocument::CreateDebugDumpPath(document_name,
+ FILE_PATH_LITERAL(".prn")).value();
+ if (!debug_dump_path.empty())
+ di.lpszOutput = debug_dump_path.c_str();
// No message loop running in unit tests.
DCHECK(!base::MessageLoop::current() ||
« no previous file with comments | « printing/printing_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698