OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/utility/printing_handler.h" | 5 #include "chrome/utility/printing_handler.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_native_library.h" | 10 #include "base/scoped_native_library.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return rv; | 172 return rv; |
173 } | 173 } |
174 | 174 |
175 class PdfFunctionsWin : public PdfFunctionsBase { | 175 class PdfFunctionsWin : public PdfFunctionsBase { |
176 public: | 176 public: |
177 PdfFunctionsWin() : render_pdf_to_dc_func_(NULL) { | 177 PdfFunctionsWin() : render_pdf_to_dc_func_(NULL) { |
178 } | 178 } |
179 | 179 |
180 bool PlatformInit( | 180 bool PlatformInit( |
181 const base::FilePath& pdf_module_path, | 181 const base::FilePath& pdf_module_path, |
182 const base::ScopedNativeLibrary& pdf_lib) OVERRIDE { | 182 const base::ScopedNativeLibrary& pdf_lib) override { |
183 // Patch the IAT for handling specific APIs known to fail in the sandbox. | 183 // Patch the IAT for handling specific APIs known to fail in the sandbox. |
184 if (!g_iat_patch_createdca.is_patched()) { | 184 if (!g_iat_patch_createdca.is_patched()) { |
185 g_iat_patch_createdca.Patch(pdf_module_path.value().c_str(), | 185 g_iat_patch_createdca.Patch(pdf_module_path.value().c_str(), |
186 "gdi32.dll", "CreateDCA", | 186 "gdi32.dll", "CreateDCA", |
187 UtilityProcess_CreateDCAPatch); | 187 UtilityProcess_CreateDCAPatch); |
188 } | 188 } |
189 | 189 |
190 if (!g_iat_patch_get_font_data.is_patched()) { | 190 if (!g_iat_patch_get_font_data.is_patched()) { |
191 g_iat_patch_get_font_data.Patch(pdf_module_path.value().c_str(), | 191 g_iat_patch_get_font_data.Patch(pdf_module_path.value().c_str(), |
192 "gdi32.dll", "GetFontData", | 192 "gdi32.dll", "GetFontData", |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 &printer_info)) { | 518 &printer_info)) { |
519 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded( | 519 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded( |
520 printer_name, printer_info)); | 520 printer_name, printer_info)); |
521 } else { | 521 } else { |
522 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( | 522 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( |
523 printer_name)); | 523 printer_name)); |
524 } | 524 } |
525 ReleaseProcessIfNeeded(); | 525 ReleaseProcessIfNeeded(); |
526 } | 526 } |
527 #endif // ENABLE_FULL_PRINTING | 527 #endif // ENABLE_FULL_PRINTING |
OLD | NEW |