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

Side by Side Diff: printing/printed_document.cc

Issue 654013: Deprecate file_util::AppendToPath() on non-Windows. (Closed)
Patch Set: ok Created 10 years, 9 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
« no previous file with comments | « chrome/plugin/chrome_plugin_host.cc ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/printed_document.h" 5 #include "printing/printed_document.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "app/gfx/font.h" 9 #include "app/gfx/font.h"
10 #include "app/gfx/text_elider.h" 10 #include "app/gfx/text_elider.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 filename += L"_"; 263 filename += L"_";
264 filename += StringPrintf(L"%02d", page.page_number()); 264 filename += StringPrintf(L"%02d", page.page_number());
265 filename += L"_.emf"; 265 filename += L"_.emf";
266 #if defined(OS_WIN) 266 #if defined(OS_WIN)
267 file_util::ReplaceIllegalCharactersInPath(&filename, '_'); 267 file_util::ReplaceIllegalCharactersInPath(&filename, '_');
268 #else 268 #else
269 std::string narrow_filename = WideToUTF8(filename); 269 std::string narrow_filename = WideToUTF8(filename);
270 file_util::ReplaceIllegalCharactersInPath(&narrow_filename, '_'); 270 file_util::ReplaceIllegalCharactersInPath(&narrow_filename, '_');
271 filename = UTF8ToWide(narrow_filename); 271 filename = UTF8ToWide(narrow_filename);
272 #endif 272 #endif
273 std::wstring path(g_debug_dump_info->debug_dump_path); 273 FilePath path = FilePath::FromWStringHack(
274 file_util::AppendToPath(&path, filename); 274 g_debug_dump_info->debug_dump_path);
275 #if defined(OS_WIN) 275 #if defined(OS_WIN)
276 page.native_metafile()->SaveTo(path); 276 page.native_metafile()->SaveTo(path.Append(filename).ToWStringHack());
277 #else // OS_WIN 277 #else // OS_WIN
278 NOTIMPLEMENTED(); 278 NOTIMPLEMENTED();
279 #endif // OS_WIN 279 #endif // OS_WIN
280 } 280 }
281 281
282 void PrintedDocument::set_debug_dump_path(const std::wstring& debug_dump_path) { 282 void PrintedDocument::set_debug_dump_path(const std::wstring& debug_dump_path) {
283 g_debug_dump_info->enabled = !debug_dump_path.empty(); 283 g_debug_dump_info->enabled = !debug_dump_path.empty();
284 g_debug_dump_info->debug_dump_path = debug_dump_path; 284 g_debug_dump_info->debug_dump_path = debug_dump_path;
285 } 285 }
286 286
(...skipping 24 matching lines...) Expand all
311 date_ = win_util::FormatSystemDate(systemtime, std::wstring()); 311 date_ = win_util::FormatSystemDate(systemtime, std::wstring());
312 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); 312 time_ = win_util::FormatSystemTime(systemtime, std::wstring());
313 #else // OS_WIN 313 #else // OS_WIN
314 Time now = Time::Now(); 314 Time now = Time::Now();
315 date_ = base::TimeFormatShortDateNumeric(now); 315 date_ = base::TimeFormatShortDateNumeric(now);
316 time_ = base::TimeFormatTimeOfDay(now); 316 time_ = base::TimeFormatTimeOfDay(now);
317 #endif // OS_WIN 317 #endif // OS_WIN
318 } 318 }
319 319
320 } // namespace printing 320 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/plugin/chrome_plugin_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698