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

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

Issue 588713002: Compile print_preview, part 3: reduce down to 185 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview_2
Patch Set: fix assert Created 6 years, 3 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/print_ticket_store.js
diff --git a/chrome/browser/resources/print_preview/data/print_ticket_store.js b/chrome/browser/resources/print_preview/data/print_ticket_store.js
index c23a98000ef411e112747008d6af60bf94775521..82332e101d711827e615b1a95bac94c825f050e6 100644
--- a/chrome/browser/resources/print_preview/data/print_ticket_store.js
+++ b/chrome/browser/resources/print_preview/data/print_ticket_store.js
@@ -305,52 +305,62 @@ cr.define('print_preview', function() {
// Initialize ticket with user's previous values.
if (this.appState_.hasField(
print_preview.AppState.Field.IS_COLOR_ENABLED)) {
- this.color_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_COLOR_ENABLED));
+ this.color_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_COLOR_ENABLED)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.IS_DUPLEX_ENABLED)) {
- this.duplex_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_DUPLEX_ENABLED));
+ this.duplex_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_DUPLEX_ENABLED)));
}
if (this.appState_.hasField(print_preview.AppState.Field.MEDIA_SIZE)) {
- this.mediaSize_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.MEDIA_SIZE));
+ this.mediaSize_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.MEDIA_SIZE)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.IS_LANDSCAPE_ENABLED)) {
- this.landscape_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_LANDSCAPE_ENABLED));
+ this.landscape_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_LANDSCAPE_ENABLED)));
}
// Initialize margins after landscape because landscape may reset margins.
if (this.appState_.hasField(print_preview.AppState.Field.MARGINS_TYPE)) {
this.marginsType_.updateValue(
- this.appState_.getField(print_preview.AppState.Field.MARGINS_TYPE));
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.MARGINS_TYPE)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.CUSTOM_MARGINS)) {
- this.customMargins_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.CUSTOM_MARGINS));
+ this.customMargins_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.CUSTOM_MARGINS)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.IS_HEADER_FOOTER_ENABLED)) {
- this.headerFooter_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_HEADER_FOOTER_ENABLED));
+ this.headerFooter_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_HEADER_FOOTER_ENABLED)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.IS_COLLATE_ENABLED)) {
- this.collate_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_COLLATE_ENABLED));
+ this.collate_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_COLLATE_ENABLED)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED)) {
- this.cssBackground_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED));
+ this.cssBackground_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED)));
}
if (this.appState_.hasField(
print_preview.AppState.Field.VENDOR_OPTIONS)) {
- this.vendorItems_.updateValue(this.appState_.getField(
- print_preview.AppState.Field.VENDOR_OPTIONS));
+ this.vendorItems_.updateValue(
+ /** @type {!Object.<string, string>} */(this.appState_.getField(
+ print_preview.AppState.Field.VENDOR_OPTIONS)));
}
},
@@ -498,7 +508,8 @@ cr.define('print_preview', function() {
* @private
*/
onSelectedDestinationCapabilitiesReady_: function() {
- var caps = this.destinationStore_.selectedDestination.capabilities;
+ var caps = assert(
+ this.destinationStore_.selectedDestination.capabilities);
var isFirstUpdate = this.capabilitiesHolder_.get() == null;
this.capabilitiesHolder_.set(caps);
if (isFirstUpdate) {

Powered by Google App Engine
This is Rietveld 408576698