diff options
author | abodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 00:01:27 +0000 |
---|---|---|
committer | abodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 00:01:27 +0000 |
commit | b579afd5e836551367c5a96be8c699df6cba7554 (patch) | |
tree | 82c7d19e53121b21bc914a0fa750ff7451e99c4f /printing/backend | |
parent | 753469d74234fe099fd4ce21178ea1e92b15535e (diff) | |
download | chromium_src-b579afd5e836551367c5a96be8c699df6cba7554.zip chromium_src-b579afd5e836551367c5a96be8c699df6cba7554.tar.gz chromium_src-b579afd5e836551367c5a96be8c699df6cba7554.tar.bz2 |
Initial support for cloudprint in print preview.
To enable in Windows/Mac/Linux pass "--enable-cloud-print --enable-print-preview" on the command line.
To enable in ChromeOS open about:flags and enable print preview.
This first pass extends the print preview UI to retrieve a printer list from cloud print and to allow printing to a cloud print printer.
Limitations/known issues:
Sign in opens a new tab and requires the print preview page to be refreshed after sign in.
Only pulls the first 10 GCP printers.
Job settings are very limited. Only sets color and only for a limited set of printers.
BUG=80004
TEST=
When running with default flags the only visible change should be that "Manage Printers" is now "Manage Local Printers"
With flags set as above there should be new entries in the printer selection dropdown allowing the use of cloud printers. It should be possible to sign in to cloud print, open the management page, and be able to print documents to cloud printers.
Review URL: http://codereview.chromium.org/7038028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/backend')
-rw-r--r-- | printing/backend/print_backend_chromeos.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/printing/backend/print_backend_chromeos.cc b/printing/backend/print_backend_chromeos.cc new file mode 100644 index 0000000..c61bc1d --- /dev/null +++ b/printing/backend/print_backend_chromeos.cc @@ -0,0 +1,60 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "printing/backend/print_backend.h" + +#include "base/logging.h" + +namespace printing { + +// Provides a stubbed out PrintBackend implementation for use on ChromeOS. +class PrintBackendChromeOS : public PrintBackend { + public: + PrintBackendChromeOS(); + virtual ~PrintBackendChromeOS() {} + + // PrintBackend implementation. + virtual bool EnumeratePrinters(PrinterList* printer_list); + + virtual std::string GetDefaultPrinterName(); + + virtual bool GetPrinterCapsAndDefaults(const std::string& printer_name, + PrinterCapsAndDefaults* printer_info); + + virtual bool IsValidPrinter(const std::string& printer_name); + + private: +}; + +PrintBackendChromeOS::PrintBackendChromeOS() {} + +bool PrintBackendChromeOS::EnumeratePrinters(PrinterList* printer_list) { + return true; +} + + + +bool PrintBackendChromeOS::GetPrinterCapsAndDefaults( + const std::string& printer_name, + PrinterCapsAndDefaults* printer_info) { + NOTREACHED(); + return false; +} + +std::string PrintBackendChromeOS::GetDefaultPrinterName() { + return std::string(); +} + +bool PrintBackendChromeOS::IsValidPrinter(const std::string& printer_name) { + NOTREACHED(); + return true; +} + +scoped_refptr<PrintBackend> PrintBackend::CreateInstance( + const base::DictionaryValue* print_backend_settings) { + return new PrintBackendChromeOS(); +} + +} // namespace printing + |