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

Side by Side Diff: chrome/service/cloud_print/print_system_win.cc

Issue 10941025: Simplify document title for Windows printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | printing/DEPS » ('j') | printing/backend/win_helper.cc » ('J')
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 "chrome/service/cloud_print/print_system.h" 5 #include "chrome/service/cloud_print/print_system.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 #include <xpsprint.h> 9 #include <xpsprint.h>
10 10
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 HDC dc = CreateDC(L"WINSPOOL", UTF8ToWide(printer_name).c_str(), 424 HDC dc = CreateDC(L"WINSPOOL", UTF8ToWide(printer_name).c_str(),
425 NULL, pt_dev_mode.dm_); 425 NULL, pt_dev_mode.dm_);
426 if (!dc) { 426 if (!dc) {
427 NOTREACHED(); 427 NOTREACHED();
428 return false; 428 return false;
429 } 429 }
430 hr = E_FAIL; 430 hr = E_FAIL;
431 DOCINFO di = {0}; 431 DOCINFO di = {0};
432 di.cbSize = sizeof(DOCINFO); 432 di.cbSize = sizeof(DOCINFO);
433 std::wstring doc_name = UTF8ToWide(job_title); 433 std::string doc_name =
434 printing::SimplifyDocumentTitle(UTF8ToWide(job_title));
434 di.lpszDocName = doc_name.c_str(); 435 di.lpszDocName = doc_name.c_str();
435 job_id_ = StartDoc(dc, &di); 436 job_id_ = StartDoc(dc, &di);
436 if (job_id_ <= 0) 437 if (job_id_ <= 0)
437 return false; 438 return false;
438 439
439 printer_dc_.Set(dc); 440 printer_dc_.Set(dc);
440 saved_dc_ = SaveDC(printer_dc_.Get()); 441 saved_dc_ = SaveDC(printer_dc_.Get());
441 print_data_file_path_ = print_data_file_path; 442 print_data_file_path_ = print_data_file_path;
442 delegate_ = delegate; 443 delegate_ = delegate;
443 RenderNextPDFPages(); 444 RenderNextPDFPages();
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); 901 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string));
901 return ret; 902 return ret;
902 } 903 }
903 904
904 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 905 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
905 const base::DictionaryValue* print_system_settings) { 906 const base::DictionaryValue* print_system_settings) {
906 return new PrintSystemWin; 907 return new PrintSystemWin;
907 } 908 }
908 909
909 } // namespace cloud_print 910 } // namespace cloud_print
OLDNEW
« no previous file with comments | « no previous file | printing/DEPS » ('j') | printing/backend/win_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698