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

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

Issue 606213002: Compile print_preview, part 6: reduce down to 48 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@J_print_preview_5
Patch Set: vitalybuka@'s review 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/destination_store.js
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js
index c01df39fa5c71fbf72c513c7087ca75e54d0d0b0..a6b6916f2435e493fc58c48aa99d02010bf22248 100644
--- a/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -202,8 +202,8 @@ cr.define('print_preview', function() {
/**
* Localizes printer capabilities.
- * @param {!Object} capabilities Printer capabilities to localize.
- * @return {!Object} Localized capabilities.
+ * @param {!print_preview.Cdd} capabilities Printer capabilities to localize.
+ * @return {!print_preview.Cdd} Localized capabilities.
* @private
*/
DestinationStore.localizeCapabilities_ = function(capabilities) {
@@ -494,7 +494,8 @@ cr.define('print_preview', function() {
*/
startLoadCloudDestinations: function(opt_origin) {
if (this.cloudPrintInterface_ != null) {
- var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || [];
+ var origins = this.userInfo_.activeUser ?
+ (this.loadedCloudOrigins_[this.userInfo_.activeUser] || []) : [];
if (origins.length == 0 ||
(opt_origin && origins.indexOf(opt_origin) < 0)) {
this.cloudPrintInterface_.search(
@@ -507,7 +508,8 @@ cr.define('print_preview', function() {
/** Requests load of COOKIE based cloud destinations. */
reloadUserCookieBasedDestinations: function() {
- var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || [];
+ var origins = this.userInfo_.activeUser ?
+ (this.loadedCloudOrigins_[this.userInfo_.activeUser] || []) : [];
if (origins.indexOf(print_preview.Destination.Origin.COOKIES) >= 0) {
cr.dispatchSimpleEvent(
this, DestinationStore.EventType.DESTINATION_SEARCH_DONE);
@@ -741,7 +743,8 @@ cr.define('print_preview', function() {
* @private
*/
onLocalDestinationCapabilitiesSet_: function(event) {
- var destinationId = event.settingsInfo['printerId'];
+ var destinationId = /** @type {string} */(
+ event.settingsInfo['printerId']);
var key = this.getDestinationKey_(
print_preview.Destination.Origin.LOCAL,
destinationId,
@@ -864,7 +867,12 @@ cr.define('print_preview', function() {
/**
* Called when a Privet printer is added to the local network.
- * @param {Object} event Contains information about the added printer.
+ * @param {{printer: {serviceName: string,
+ * name: string,
+ * hasLocalPrinting: boolean,
+ * isUnregistered: boolean,
+ * cloudID: string}}} event Contains information about
+ * the added printer.
* @private
*/
onPrivetPrinterAdded_: function(event) {
@@ -884,7 +892,6 @@ cr.define('print_preview', function() {
* @private
*/
onPrivetCapabilitiesSet_: function(event) {
- var destinationId = event.printerId;
var destinations =
print_preview.PrivetDestinationParser.parse(event.printer);
destinations.forEach(function(dest) {

Powered by Google App Engine
This is Rietveld 408576698