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

Side by Side Diff: chrome/browser/resources/print_preview/search/destination_list.js

Issue 574193002: Compile print_preview, part 1: remove all warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Component that displays a list of destinations with a heading, action link, 9 * Component that displays a list of destinations with a heading, action link,
10 * and "Show All..." button. An event is dispatched when the action link is 10 * and "Show All..." button. An event is dispatched when the action link is
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 }, 114 },
115 115
116 /** @return {number} Count of the destinations in the list. */ 116 /** @return {number} Count of the destinations in the list. */
117 getDestinationsCount: function() { 117 getDestinationsCount: function() {
118 return this.destinations_.length; 118 return this.destinations_.length;
119 }, 119 },
120 120
121 /** 121 /**
122 * Gets estimated height of the destination list for the given number of 122 * Gets estimated height of the destination list for the given number of
123 * items. 123 * items.
124 * @param {number} Number of items to render in the destination list. 124 * @param {number} numItems Number of items to render in the destination
125 * list.
125 * @return {number} Height (in pixels) of the destination list. 126 * @return {number} Height (in pixels) of the destination list.
126 */ 127 */
127 getEstimatedHeightInPixels: function(numItems) { 128 getEstimatedHeightInPixels: function(numItems) {
128 numItems = Math.min(numItems, this.destinations_.length); 129 numItems = Math.min(numItems, this.destinations_.length);
129 var headerHeight = 130 var headerHeight =
130 this.getChildElement('.destination-list > header').offsetHeight; 131 this.getChildElement('.destination-list > header').offsetHeight;
131 return headerHeight + (numItems > 0 ? 132 return headerHeight + (numItems > 0 ?
132 numItems * DestinationList.HEIGHT_OF_ITEM_ : 133 numItems * DestinationList.HEIGHT_OF_ITEM_ :
133 // To account for "No destinations found" message. 134 // To account for "No destinations found" message.
134 DestinationList.HEIGHT_OF_ITEM_); 135 DestinationList.HEIGHT_OF_ITEM_);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 cr.dispatchSimpleEvent(this, 266 cr.dispatchSimpleEvent(this,
266 DestinationList.EventType.ACTION_LINK_ACTIVATED); 267 DestinationList.EventType.ACTION_LINK_ACTIVATED);
267 } 268 }
268 }; 269 };
269 270
270 // Export 271 // Export
271 return { 272 return {
272 DestinationList: DestinationList 273 DestinationList: DestinationList
273 }; 274 };
274 }); 275 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698