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

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

Issue 11194020: Creates GCP promo for ChromeOS users with no cloud printers. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk. Created 8 years, 2 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 2b406098a894074b25bb9528d2484ea313224f1f..4c7e15c0157150edb22dbc2685628eb579f80a6b 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -25,6 +25,13 @@ cr.define('print_preview', function() {
this.isSelectedDestinationLocal_ = null;
/**
+ * Whether the GCP promotion has been dismissed.
+ * @type {boolean}
+ * @private
+ */
+ this.isGcpPromoDismissed_ = true;
+
+ /**
* Margins type.
* @type {print_preview.ticket_items.MarginsType.Value}
* @private
@@ -92,6 +99,7 @@ cr.define('print_preview', function() {
VERSION: 'version',
SELECTED_DESTINATION_ID: 'selectedDestinationId',
IS_SELECTED_DESTINATION_LOCAL: 'isSelectedDestinationLocal',
+ IS_GCP_PROMO_DISMISSED: 'isGcpPromoDismissed',
MARGINS_TYPE: 'marginsType',
CUSTOM_MARGINS: 'customMargins',
IS_COLOR_ENABLED: 'isColorEnabled',
@@ -120,6 +128,11 @@ cr.define('print_preview', function() {
return this.isSelectedDestinationLocal_;
},
+ /** @return {boolean} Whether the GCP promotion has been dismissed. */
+ get isGcpPromoDismissed() {
+ return this.isGcpPromoDismissed_;
+ },
+
/** @return {print_preview.ticket_items.MarginsType.Value} Margins type. */
get marginsType() {
return this.marginsType_;
@@ -175,6 +188,8 @@ cr.define('print_preview', function() {
this.isSelectedDestinationLocal_ =
state[AppState.Field_.IS_SELECTED_DESTINATION_LOCAL];
}
+ this.isGcpPromoDismissed_ =
+ state[AppState.Field_.IS_GCP_PROMO_DISMISSED] || false;
if (state.hasOwnProperty(AppState.Field_.MARGINS_TYPE)) {
this.marginsType_ = state[AppState.Field_.MARGINS_TYPE];
}
@@ -212,6 +227,16 @@ cr.define('print_preview', function() {
this.persist_();
},
+ /**
+ * Persists whether the GCP promotion has been dismissed.
+ * @param {boolean} isGcpPromoDismissed Whether the GCP promotion has been
+ * dismissed.
+ */
+ persistIsGcpPromoDismissed: function(isGcpPromoDismissed) {
+ this.isGcpPromoDismissed_ = isGcpPromoDismissed;
+ this.persist_();
+ },
+
/**
* Persists the margins type.
* @param {print_preview.ticket_items.MarginsType.Value} marginsType Margins
@@ -287,6 +312,7 @@ cr.define('print_preview', function() {
this.selectedDestinationId_;
obj[AppState.Field_.IS_SELECTED_DESTINATION_LOCAL] =
this.isSelectedDestinationLocal_;
+ obj[AppState.Field_.IS_GCP_PROMO_DISMISSED] = this.isGcpPromoDismissed_;
obj[AppState.Field_.MARGINS_TYPE] = this.marginsType_;
if (this.customMargins_) {
obj[AppState.Field_.CUSTOM_MARGINS] = this.customMargins_.serialize();

Powered by Google App Engine
This is Rietveld 408576698