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

Unified Diff: chrome/browser/resources/print_preview/data/app_state.js

Issue 11818062: Adds option to enable CSS backgrounds for printing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk. Created 7 years, 11 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
Index: chrome/browser/resources/print_preview/data/app_state.js
diff --git a/chrome/browser/resources/print_preview/data/app_state.js b/chrome/browser/resources/print_preview/data/app_state.js
index 9ce3327766a5df7791225c2fec6b7396f4bd60d8..d3ffd8f0b653b79aa1858cc059a2d422c9765f37 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -79,6 +79,13 @@ cr.define('print_preview', function() {
* @private
*/
this.isCollateEnabled_ = null;
+
+ /**
+ * Whether printing CSS backgrounds is enabled.
+ * @type {?boolean}
+ * @private
+ */
+ this.isCssBackgroundEnabled_ = null;
};
/**
@@ -106,7 +113,8 @@ cr.define('print_preview', function() {
IS_DUPLEX_ENABLED: 'isDuplexEnabled',
IS_HEADER_FOOTER_ENABLED: 'isHeaderFooterEnabled',
IS_LANDSCAPE_ENABLED: 'isLandscapeEnabled',
- IS_COLLATE_ENABLED: 'isCollateEnabled'
+ IS_COLLATE_ENABLED: 'isCollateEnabled',
+ IS_CSS_BACKGROUND_ENABLED: 'isCssBackgroundEnabled'
};
/**
@@ -168,6 +176,11 @@ cr.define('print_preview', function() {
return this.isCollateEnabled_;
},
+ /** @return {?boolean} Whether printing CSS backgrounds is enabled. */
+ get isCssBackgroundEnabled() {
+ return this.isCssBackgroundEnabled_;
+ },
+
/**
* Initializes the app state from a serialized string returned by the native
* layer.
@@ -216,6 +229,10 @@ cr.define('print_preview', function() {
if (state.hasOwnProperty(AppState.Field_.IS_COLLATE_ENABLED)) {
this.isCollateEnabled_ = state[AppState.Field_.IS_COLLATE_ENABLED];
}
+ if (state.hasOwnProperty(AppState.Field_.IS_CSS_BACKGROUND_ENABLED)) {
+ this.isCssBackgroundEnabled_ =
+ state[AppState.Field_.IS_CSS_BACKGROUND_ENABLED];
+ }
}
},
@@ -304,6 +321,16 @@ cr.define('print_preview', function() {
},
/**
+ * Persists whether printing CSS backgrounds is enabled.
+ * @param {?boolean} isCssBackgroundEnabled Whether printing CSS
+ * backgrounds is enabled.
+ */
+ persistIsCssBackgroundEnabled: function(isCssBackgroundEnabled) {
+ this.isCssBackgroundEnabled_ = isCssBackgroundEnabled;
+ this.persist_();
+ },
+
+ /**
* Calls into the native layer to persist the application state.
* @private
*/
@@ -325,6 +352,8 @@ cr.define('print_preview', function() {
this.isHeaderFooterEnabled_;
obj[AppState.Field_.IS_LANDSCAPE_ENABLED] = this.isLandscapeEnabled_;
obj[AppState.Field_.IS_COLLATE_ENABLED] = this.isCollateEnabled_;
+ obj[AppState.Field_.IS_CSS_BACKGROUND_ENABLED] =
+ this.isCssBackgroundEnabled_;
chrome.send(AppState.NATIVE_FUNCTION_NAME_, [JSON.stringify(obj)]);
}
};
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/browser/resources/print_preview/data/print_ticket_store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698