| 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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 int height_microns = | 1047 int height_microns = |
| 1048 static_cast<int>(page_size_in.height() * device_microns_per_unit); | 1048 static_cast<int>(page_size_in.height() * device_microns_per_unit); |
| 1049 int width_microns = | 1049 int width_microns = |
| 1050 static_cast<int>(page_size_in.width() * device_microns_per_unit); | 1050 static_cast<int>(page_size_in.width() * device_microns_per_unit); |
| 1051 auto media_size = base::MakeUnique<base::DictionaryValue>(); | 1051 auto media_size = base::MakeUnique<base::DictionaryValue>(); |
| 1052 media_size->SetInteger(kSettingMediaSizeHeightMicrons, height_microns); | 1052 media_size->SetInteger(kSettingMediaSizeHeightMicrons, height_microns); |
| 1053 media_size->SetInteger(kSettingMediaSizeWidthMicrons, width_microns); | 1053 media_size->SetInteger(kSettingMediaSizeWidthMicrons, width_microns); |
| 1054 | 1054 |
| 1055 // Non default scaling value | 1055 // Non default scaling value |
| 1056 dict.SetInteger(kSettingScaleFactor, 80); | 1056 dict.SetInteger(kSettingScaleFactor, 80); |
| 1057 dict.Set(kSettingMediaSize, media_size.release()); | 1057 dict.Set(kSettingMediaSize, std::move(media_size)); |
| 1058 | 1058 |
| 1059 OnPrintForPrintPreview(dict); | 1059 OnPrintForPrintPreview(dict); |
| 1060 | 1060 |
| 1061 VerifyPrintFailed(false); | 1061 VerifyPrintFailed(false); |
| 1062 VerifyPagesPrinted(true); | 1062 VerifyPagesPrinted(true); |
| 1063 #if defined(OS_WIN) | 1063 #if defined(OS_WIN) |
| 1064 VerifyPrintedPageSize(page_size_in); | 1064 VerifyPrintedPageSize(page_size_in); |
| 1065 #endif | 1065 #endif |
| 1066 } | 1066 } |
| 1067 | 1067 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1156 |
| 1157 VerifyPrintFailed(true); | 1157 VerifyPrintFailed(true); |
| 1158 VerifyPagesPrinted(false); | 1158 VerifyPagesPrinted(false); |
| 1159 } | 1159 } |
| 1160 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) | 1160 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
| 1161 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 1161 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 1162 | 1162 |
| 1163 #endif // !defined(OS_CHROMEOS) | 1163 #endif // !defined(OS_CHROMEOS) |
| 1164 | 1164 |
| 1165 } // namespace printing | 1165 } // namespace printing |
| OLD | NEW |