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

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

Issue 2760753002: [CUPS] Implement the local CUPS printer setup waiting UI. (Closed)
Patch Set: Address dpapad@'s comments. Fix failed test. Created 3 years, 8 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 this.renderDestinations_(); 218 this.renderDestinations_();
219 }, 219 },
220 220
221 /** @param {RegExp} query Query to update the filter with. */ 221 /** @param {RegExp} query Query to update the filter with. */
222 updateSearchQuery: function(query) { 222 updateSearchQuery: function(query) {
223 this.query_ = query; 223 this.query_ = query;
224 this.renderDestinations_(); 224 this.renderDestinations_();
225 }, 225 },
226 226
227 /** 227 /**
228 * @param {string} destinationId The ID of the destination.
229 * @return {?print_preview.DestinationListItem} The found destination list
230 * item or null if not found.
231 */
232 getDestinationItem: function(destinationId) {
233 return this.listItems_.find(function(listItem) {
234 return listItem.destination.id == destinationId;
235 }) || null;
236 },
237
238 /**
228 * @param {string} text Text to set the action link to. 239 * @param {string} text Text to set the action link to.
229 * @protected 240 * @protected
230 */ 241 */
231 setActionLinkTextInternal: function(text) { 242 setActionLinkTextInternal: function(text) {
232 this.actionLinkLabel_ = text; 243 this.actionLinkLabel_ = text;
233 this.getChildElement('.action-link').textContent = text; 244 this.getChildElement('.action-link').textContent = text;
234 }, 245 },
235 246
236 /** 247 /**
237 * Sets the short list size without constraints. 248 * Sets the short list size without constraints.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 cr.dispatchSimpleEvent(this, 366 cr.dispatchSimpleEvent(this,
356 DestinationList.EventType.ACTION_LINK_ACTIVATED); 367 DestinationList.EventType.ACTION_LINK_ACTIVATED);
357 } 368 }
358 }; 369 };
359 370
360 // Export 371 // Export
361 return { 372 return {
362 DestinationList: DestinationList 373 DestinationList: DestinationList
363 }; 374 };
364 }); 375 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698