Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: printing/print_settings.h

Issue 325313003: Add vendor id and custom display name to media selection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address cl comments. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/print_job_constants.cc ('k') | printing/print_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings.h
diff --git a/printing/print_settings.h b/printing/print_settings.h
index b18d86022a5e669a93cf63c76ca7b5366198ce11..b942189c2c2fd8e514235cb418592cf20600bd31 100644
--- a/printing/print_settings.h
+++ b/printing/print_settings.h
@@ -29,6 +29,19 @@ PRINTING_EXPORT void GetColorModelForMode(int color_mode,
// OS-independent print settings.
class PRINTING_EXPORT PrintSettings {
public:
+ // Media properties requested by the user. Default instance represents
+ // default media selection.
+ struct RequestedMedia {
+ // Size of the media, in microns.
+ gfx::Size size_microns;
+ // Platform specific id to map it back to the particular media.
+ std::string vendor_id;
+
+ bool IsDefault() const {
+ return size_microns.IsEmpty() && vendor_id.empty();
+ }
+ };
+
PrintSettings();
~PrintSettings();
@@ -43,6 +56,16 @@ class PRINTING_EXPORT PrintSettings {
void SetOrientation(bool landscape);
bool landscape() const { return landscape_; }
+ // Updates user requested media.
+ void set_requested_media(const RequestedMedia& media) {
+ requested_media_ = media;
+ }
+ // Media properties requested by the user. Translated into device media by the
+ // platform specific layers.
+ const RequestedMedia& requested_media() const {
+ return requested_media_;
+ }
+
// Set printer printable area in in device units.
// Some platforms already provide flipped area. Set |landscape_needs_flip|
// to false on those platforms to avoid double flipping.
@@ -174,6 +197,9 @@ class PRINTING_EXPORT PrintSettings {
// Printer device name as opened by the OS.
base::string16 device_name_;
+ // Media requested by the user.
+ RequestedMedia requested_media_;
+
// Page setup in device units.
PageSetup page_setup_device_units_;
« no previous file with comments | « printing/print_job_constants.cc ('k') | printing/print_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698