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

Unified Diff: chrome/browser/resources/print_preview/print_preview.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: revert movement of enums: now handle in compiler pass 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/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index 6f2d1a0707dfa7d01f4d4d0c2fb4597998deb3a0..bda66a66c5602cd128b5d56920b10b994d1fc49d 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -857,6 +857,9 @@ cr.define('print_preview', function() {
* to the preview area.
* @param {KeyboardEvent} e The keyboard event.
* @private
+ * @suppress {uselessCode}
+ * Current compiler preprocessor leaves all the code inside all the <if>s,
+ * so the compiler claims that code after first return is unreachable.
*/
onKeyDown_: function(e) {
// Escape key closes the dialog.
@@ -937,7 +940,7 @@ cr.define('print_preview', function() {
*/
onAdvancedOptionsButtonActivated_: function() {
this.advancedSettings_.showForDestination(
- this.destinationStore_.selectedDestination);
+ assert(this.destinationStore_.selectedDestination));
},
/**
@@ -998,6 +1001,8 @@ cr.define('print_preview', function() {
* @private
*/
onManipulateSettingsForTest_: function(event) {
+ event.settings =
Dan Beam 2014/09/29 18:42:00 nit: var settings (try not to re-assign to argumen
Vitaly Pavlenko 2014/10/01 00:33:37 Done.
+ /** @type {print_preview.PreviewSettings} */(event.settings);
if ('selectSaveAsPdfDestination' in event.settings) {
this.saveAsPdfForTest_(); // No parameters.
} else if ('layoutSettings' in event.settings) {
@@ -1137,7 +1142,7 @@ cr.define('print_preview', function() {
if (!cr.isWindows)
return true;
var selectedDest = this.destinationStore_.selectedDestination;
- return selectedDest &&
+ return !!selectedDest &&
selectedDest.origin == print_preview.Destination.Origin.LOCAL &&
selectedDest.id !=
print_preview.Destination.GooglePromotedId.SAVE_AS_PDF;
@@ -1167,7 +1172,7 @@ cr.define('print_preview', function() {
var selectedDest = this.destinationStore_.selectedDestination;
setIsVisible(
getRequiredElement('cloud-print-dialog-link'),
- selectedDest && !cr.isChromeOS && !selectedDest.isLocal);
+ !!selectedDest && !cr.isChromeOS && !selectedDest.isLocal);
setIsVisible(
getRequiredElement('system-dialog-link'),
this.shouldShowSystemDialogLink_());
@@ -1187,8 +1192,8 @@ cr.define('print_preview', function() {
this.cloudPrintInterface_ &&
this.userInfo_.activeUser &&
!this.appState_.isGcpPromoDismissed &&
- !this.destinationStore_.isLocalDestinationsSearchInProgress &&
- !this.destinationStore_.isCloudDestinationsSearchInProgress &&
+ !this.destinationStore_.isLocalDestinationSearchInProgress &&
+ !this.destinationStore_.isCloudDestinationSearchInProgress &&
this.destinationStore_.hasOnlyDefaultCloudDestinations();
setIsVisible(this.getChildElement('#no-destinations-promo'),
isPromoVisible);

Powered by Google App Engine
This is Rietveld 408576698