| OLD | NEW |
| 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 PrintSystemWin::CreateJobSpooler() { | 875 PrintSystemWin::CreateJobSpooler() { |
| 876 return new JobSpoolerWin(); | 876 return new JobSpoolerWin(); |
| 877 } | 877 } |
| 878 | 878 |
| 879 std::string PrintSystemWin::GetSupportedMimeTypes() { | 879 std::string PrintSystemWin::GetSupportedMimeTypes() { |
| 880 if (printing::XPSPrintModule::Init()) | 880 if (printing::XPSPrintModule::Init()) |
| 881 return "application/vnd.ms-xpsdocument,application/pdf"; | 881 return "application/vnd.ms-xpsdocument,application/pdf"; |
| 882 return "application/pdf"; | 882 return "application/pdf"; |
| 883 } | 883 } |
| 884 | 884 |
| 885 | |
| 886 std::string PrintSystem::GenerateProxyId() { | |
| 887 GUID proxy_id = {0}; | |
| 888 HRESULT hr = UuidCreate(&proxy_id); | |
| 889 DCHECK(SUCCEEDED(hr)); | |
| 890 wchar_t* proxy_id_as_string = NULL; | |
| 891 UuidToString(&proxy_id, reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); | |
| 892 DCHECK(proxy_id_as_string); | |
| 893 std::string ret; | |
| 894 WideToUTF8(proxy_id_as_string, wcslen(proxy_id_as_string), &ret); | |
| 895 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); | |
| 896 return ret; | |
| 897 } | |
| 898 | |
| 899 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 885 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
| 900 const base::DictionaryValue* print_system_settings) { | 886 const base::DictionaryValue* print_system_settings) { |
| 901 return new PrintSystemWin; | 887 return new PrintSystemWin; |
| 902 } | 888 } |
| 903 | 889 |
| 904 } // namespace cloud_print | 890 } // namespace cloud_print |
| OLD | NEW |