| 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 <include src="history_focus_manager.js"> | 6 <include src="history_focus_manager.js"> |
| 7 | 7 |
| 8 /////////////////////////////////////////////////////////////////////////////// | 8 /////////////////////////////////////////////////////////////////////////////// |
| 9 // Globals: | 9 // Globals: |
| 10 /** @const */ var RESULTS_PER_PAGE = 150; | 10 /** @const */ var RESULTS_PER_PAGE = 150; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 if (cr.isAndroid) { | 455 if (cr.isAndroid) { |
| 456 // On Android, if a large icon is unavailable, an HTML/CSS fallback favicon | 456 // On Android, if a large icon is unavailable, an HTML/CSS fallback favicon |
| 457 // is generated because Android does not yet support text drawing in native. | 457 // is generated because Android does not yet support text drawing in native. |
| 458 | 458 |
| 459 // Check whether a fallback favicon needs to be generated. | 459 // Check whether a fallback favicon needs to be generated. |
| 460 var desiredPixelSize = 32 * window.devicePixelRatio; | 460 var desiredPixelSize = 32 * window.devicePixelRatio; |
| 461 var img = new Image(); | 461 var img = new Image(); |
| 462 img.onload = this.onLargeFaviconLoadedAndroid_.bind(this, faviconDiv); | 462 img.onload = this.onLargeFaviconLoadedAndroid_.bind(this, faviconDiv); |
| 463 img.src = 'chrome://large-icon/' + desiredPixelSize + '/' + this.url_; | 463 img.src = 'chrome://large-icon/' + desiredPixelSize + '/' + this.url_; |
| 464 } else { | 464 } else { |
| 465 faviconDiv.style.backgroundImage = getFaviconImageSet(this.url_); | 465 faviconDiv.style.backgroundImage = cr.icon.getFaviconImageSet(this.url_); |
| 466 } | 466 } |
| 467 }; | 467 }; |
| 468 | 468 |
| 469 /** | 469 /** |
| 470 * Called when the chrome://large-icon image has finished loading. | 470 * Called when the chrome://large-icon image has finished loading. |
| 471 * @param {Element} faviconDiv The DOM element to add the favicon to. | 471 * @param {Element} faviconDiv The DOM element to add the favicon to. |
| 472 * @param {Event} event The onload event. | 472 * @param {Event} event The onload event. |
| 473 * @private | 473 * @private |
| 474 */ | 474 */ |
| 475 Visit.prototype.onLargeFaviconLoadedAndroid_ = function(faviconDiv, event) { | 475 Visit.prototype.onLargeFaviconLoadedAndroid_ = function(faviconDiv, event) { |
| (...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2402 historyView.reload(); | 2402 historyView.reload(); |
| 2403 } | 2403 } |
| 2404 | 2404 |
| 2405 // Add handlers to HTML elements. | 2405 // Add handlers to HTML elements. |
| 2406 document.addEventListener('DOMContentLoaded', load); | 2406 document.addEventListener('DOMContentLoaded', load); |
| 2407 | 2407 |
| 2408 // This event lets us enable and disable menu items before the menu is shown. | 2408 // This event lets us enable and disable menu items before the menu is shown. |
| 2409 document.addEventListener('canExecute', function(e) { | 2409 document.addEventListener('canExecute', function(e) { |
| 2410 e.canExecute = true; | 2410 e.canExecute = true; |
| 2411 }); | 2411 }); |
| OLD | NEW |