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

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: Removes extraneous comma. 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..06e8f836d1000f659c60e8fedfff1615b23ead01 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -72,6 +72,13 @@ cr.define('print_preview', function() {
* @private
*/
this.isCollateEnabled_ = null;
+
+ /**
+ * Whether the GCP promotion has been dismissed.
+ * @type {boolean}
+ * @private
+ */
+ this.isGcpPromoDismissed_ = true;
ydolgov1 2012/10/16 21:44:54 Why is it true by default? Should we initialize it
ydolgov1 2012/10/16 21:44:54 And also can you move it closer to selectedDestina
Toscano 2012/10/16 22:24:14 I'd like to keep the default behavior to not show
Toscano 2012/10/16 22:24:14 Done.
};
/**
@@ -98,7 +105,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_GCP_PROMO_DISMISSED: 'isGcpPromoDismissed'
};
/**
@@ -155,6 +163,11 @@ cr.define('print_preview', function() {
return this.isCollateEnabled_;
},
+ /** @return {boolean} Whether the GCP promotion has been dismissed. */
ydolgov1 2012/10/16 22:43:17 Can you also move this one closer to isSelectedDes
Toscano 2012/10/16 22:58:44 Done.
+ get isGcpPromoDismissed() {
+ return this.isGcpPromoDismissed_;
+ },
+
/**
* Initializes the app state from a serialized string returned by the native
* layer.
@@ -199,6 +212,8 @@ cr.define('print_preview', function() {
if (state.hasOwnProperty(AppState.Field_.IS_COLLATE_ENABLED)) {
this.isCollateEnabled_ = state[AppState.Field_.IS_COLLATE_ENABLED];
}
+ this.isGcpPromoDismissed_ =
ydolgov1 2012/10/16 22:43:17 And this closer to "this.selectedDestinationId_ =.
Toscano 2012/10/16 22:58:44 Done.
+ state[AppState.Field_.IS_GCP_PROMO_DISMISSED] || false;
}
},
@@ -277,6 +292,16 @@ cr.define('print_preview', function() {
},
/**
+ * Persists whether the GCP promotion has been dismissed.
+ * @param {boolean} isGcpPromoDismissed Whether the GCP promotion has been
+ * dismissed.
+ */
+ persistIsGcpPromoDismissed: function(isGcpPromoDismissed) {
ydolgov1 2012/10/16 22:43:17 Please fix indentation.
Toscano 2012/10/16 22:58:44 Done.
+ this.isGcpPromoDismissed_ = isGcpPromoDismissed;
+ this.persist_();
+ },
+
+ /**
* Calls into the native layer to persist the application state.
* @private
*/
@@ -297,6 +322,7 @@ 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_GCP_PROMO_DISMISSED] = this.isGcpPromoDismissed_;
ydolgov1 2012/10/16 22:43:17 And also please move this one closer to "obj[AppSt
Toscano 2012/10/16 22:58:44 Done.
chrome.send(AppState.NATIVE_FUNCTION_NAME_, [JSON.stringify(obj)]);
}
};

Powered by Google App Engine
This is Rietveld 408576698