Chromium Code Reviews| Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| index 28e220ab503a99ee2c4469da39b485b4f7a505b8..bd767fd61cd12043f240c0290a0d41ba7268828a 100644 |
| --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| @@ -344,14 +344,22 @@ std::unique_ptr<base::DictionaryValue> GetPdfCapabilities( |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| cloud_devices::CloudDeviceDescription description; |
| - using namespace cloud_devices::printer; |
| + |
| + using cloud_devices::printer::OrientationCapability; |
| + using cloud_devices::printer::PORTRAIT; |
| + using cloud_devices::printer::LANDSCAPE; |
| + using cloud_devices::printer::AUTO_ORIENTATION; |
| OrientationCapability orientation; |
| - orientation.AddOption(cloud_devices::printer::PORTRAIT); |
| - orientation.AddOption(cloud_devices::printer::LANDSCAPE); |
| + orientation.AddOption(PORTRAIT); |
| + orientation.AddOption(LANDSCAPE); |
| orientation.AddDefaultOption(AUTO_ORIENTATION, true); |
| orientation.SaveTo(&description); |
| + using cloud_devices::printer::ColorCapability; |
| + using cloud_devices::printer::Color; |
| + using cloud_devices::printer::STANDARD_COLOR; |
| + |
| ColorCapability color; |
| { |
| Color standard_color(STANDARD_COLOR); |
| @@ -360,18 +368,26 @@ std::unique_ptr<base::DictionaryValue> GetPdfCapabilities( |
| } |
| color.SaveTo(&description); |
| - static const cloud_devices::printer::MediaType kPdfMedia[] = { |
| - ISO_A0, |
| - ISO_A1, |
| - ISO_A2, |
| - ISO_A3, |
| - ISO_A4, |
| - ISO_A5, |
| - NA_LEGAL, |
| - NA_LETTER, |
| - NA_LEDGER |
| - }; |
| + using cloud_devices::printer::MediaType; |
| + using cloud_devices::printer::ISO_A0; |
| + using cloud_devices::printer::ISO_A1; |
| + using cloud_devices::printer::ISO_A2; |
| + using cloud_devices::printer::ISO_A3; |
| + using cloud_devices::printer::ISO_A4; |
| + using cloud_devices::printer::ISO_A5; |
| + using cloud_devices::printer::NA_LEGAL; |
| + using cloud_devices::printer::NA_LETTER; |
| + using cloud_devices::printer::NA_LEDGER; |
| + |
| + static const MediaType kPdfMedia[] = {ISO_A0, ISO_A1, ISO_A2, |
| + ISO_A3, ISO_A4, ISO_A5, |
| + NA_LEGAL, NA_LETTER, NA_LEDGER}; |
| + |
| const gfx::Size default_media_size = GetDefaultPdfMediaSizeMicrons(); |
| + |
| + using cloud_devices::printer::Media; |
| + using cloud_devices::printer::MediaCapability; |
| + |
| Media default_media( |
| "", "", default_media_size.width(), default_media_size.height()); |
| if (!default_media.MatchBySize() || |
| @@ -410,6 +426,12 @@ std::pair<std::string, std::string> GetPrinterNameAndDescription( |
| void EnumeratePrintersOnBlockingPoolThread(base::ListValue* printers) { |
| DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| +#if defined(OS_CHROMEOS) |
| + printing::PrintBackend::SetNativeCupsEnabled( |
|
Lei Zhang
2016/06/28 22:27:35
We probably don't need to set the same value every
skau
2016/06/28 23:58:19
I've moved it to ChromeBrowserMainChromeos since t
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableNativeCups)); |
| +#endif // defined(OS_CHROMEOS) |
| + |
| scoped_refptr<printing::PrintBackend> print_backend( |
| printing::PrintBackend::CreateInstance(nullptr)); |