| OLD | NEW |
| 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 used for searching for a print destination. | 9 * Component used for searching for a print destination. |
| 10 * This is a modal dialog that allows the user to search and select a | 10 * This is a modal dialog that allows the user to search and select a |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 * @type {bool} | 48 * @type {bool} |
| 49 * @private | 49 * @private |
| 50 */ | 50 */ |
| 51 this.registerPromoShownMetricRecorded_ = false; | 51 this.registerPromoShownMetricRecorded_ = false; |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * Search box used to search through the destination lists. | 54 * Search box used to search through the destination lists. |
| 55 * @type {!print_preview.SearchBox} | 55 * @type {!print_preview.SearchBox} |
| 56 * @private | 56 * @private |
| 57 */ | 57 */ |
| 58 this.searchBox_ = new print_preview.SearchBox(); | 58 this.searchBox_ = new print_preview.SearchBox( |
| 59 localStrings.getString('searchBoxPlaceholder')); |
| 59 this.addChild(this.searchBox_); | 60 this.addChild(this.searchBox_); |
| 60 | 61 |
| 61 /** | 62 /** |
| 62 * Destination list containing recent destinations. | 63 * Destination list containing recent destinations. |
| 63 * @type {!print_preview.DestinationList} | 64 * @type {!print_preview.DestinationList} |
| 64 * @private | 65 * @private |
| 65 */ | 66 */ |
| 66 this.recentList_ = new print_preview.RecentDestinationList(this); | 67 this.recentList_ = new print_preview.RecentDestinationList(this); |
| 67 this.addChild(this.recentList_); | 68 this.addChild(this.recentList_); |
| 68 | 69 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 this.tracker.add(window, 'resize', this.onWindowResize_.bind(this)); | 254 this.tracker.add(window, 'resize', this.onWindowResize_.bind(this)); |
| 254 | 255 |
| 255 this.updateThrobbers_(); | 256 this.updateThrobbers_(); |
| 256 | 257 |
| 257 // Render any destinations already in the store. | 258 // Render any destinations already in the store. |
| 258 this.renderDestinations_(); | 259 this.renderDestinations_(); |
| 259 }, | 260 }, |
| 260 | 261 |
| 261 /** @override */ | 262 /** @override */ |
| 262 decorateInternal: function() { | 263 decorateInternal: function() { |
| 263 this.searchBox_.decorate($('search-box')); | 264 this.searchBox_.render(this.getChildElement('.search-box-container')); |
| 264 this.recentList_.render(this.getChildElement('.recent-list')); | 265 this.recentList_.render(this.getChildElement('.recent-list')); |
| 265 this.localList_.render(this.getChildElement('.local-list')); | 266 this.localList_.render(this.getChildElement('.local-list')); |
| 266 this.cloudList_.render(this.getChildElement('.cloud-list')); | 267 this.cloudList_.render(this.getChildElement('.cloud-list')); |
| 267 this.getChildElement('.promo-text').innerHTML = localStrings.getStringF( | 268 this.getChildElement('.promo-text').innerHTML = localStrings.getStringF( |
| 268 'cloudPrintPromotion', | 269 'cloudPrintPromotion', |
| 269 '<span class="sign-in link-button">', | 270 '<span class="sign-in link-button">', |
| 270 '</span>'); | 271 '</span>'); |
| 271 this.getChildElement('.account-select-label').textContent = | 272 this.getChildElement('.account-select-label').textContent = |
| 272 localStrings.getString('accountSelectTitle'); | 273 localStrings.getString('accountSelectTitle'); |
| 273 }, | 274 }, |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 onWindowResize_: function() { | 635 onWindowResize_: function() { |
| 635 this.reflowLists_(); | 636 this.reflowLists_(); |
| 636 } | 637 } |
| 637 }; | 638 }; |
| 638 | 639 |
| 639 // Export | 640 // Export |
| 640 return { | 641 return { |
| 641 DestinationSearch: DestinationSearch | 642 DestinationSearch: DestinationSearch |
| 642 }; | 643 }; |
| 643 }); | 644 }); |
| OLD | NEW |