| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // File Description: | 5 // File Description: |
| 6 // Contains all the necessary functions for rendering the NTP on mobile | 6 // Contains all the necessary functions for rendering the NTP on mobile |
| 7 // devices. | 7 // devices. |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The event type used to determine when a touch starts. | 10 * The event type used to determine when a touch starts. |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 foldDiv.style['background'] = | 698 foldDiv.style['background'] = |
| 699 '-webkit-canvas(fold_' + faviconIndex + ')'; | 699 '-webkit-canvas(fold_' + faviconIndex + ')'; |
| 700 | 700 |
| 701 // Use a container so that the fold it self can be zoomed without | 701 // Use a container so that the fold it self can be zoomed without |
| 702 // changing the positioning of the fold. | 702 // changing the positioning of the fold. |
| 703 var foldContainer = createDiv('fold-container'); | 703 var foldContainer = createDiv('fold-container'); |
| 704 foldContainer.appendChild(foldDiv); | 704 foldContainer.appendChild(foldDiv); |
| 705 faviconBox.appendChild(foldContainer); | 705 faviconBox.appendChild(foldContainer); |
| 706 | 706 |
| 707 chrome.send('getFaviconDominantColor', | 707 chrome.send('getFaviconDominantColor', |
| 708 [('chrome://favicon/size/16/' + item.url), '' + faviconIndex]); | 708 [('chrome://favicon/size/16@1x/' + item.url), '' + faviconIndex]); |
| 709 faviconIndex++; | 709 faviconIndex++; |
| 710 } else if ((w == 57 && h == 57) || (w == 114 && h == 114)) { | 710 } else if ((w == 57 && h == 57) || (w == 114 && h == 114)) { |
| 711 // it's a touch icon | 711 // it's a touch icon |
| 712 faviconIcon.classList.add('touch-icon'); | 712 faviconIcon.classList.add('touch-icon'); |
| 713 } else { | 713 } else { |
| 714 // it's an html5 icon (or at least it's larger) | 714 // it's an html5 icon (or at least it's larger) |
| 715 var max = 64; | 715 var max = 64; |
| 716 if (w > max || h > max) { | 716 if (w > max || h > max) { |
| 717 var scale = (w > h) ? (max / w) : (max / h); | 717 var scale = (w > h) ? (max / w) : (max / h); |
| 718 w *= scale; | 718 w *= scale; |
| (...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 // NTP Entry point. | 2644 // NTP Entry point. |
| 2645 ///////////////////////////////////////////////////////////////////////////// | 2645 ///////////////////////////////////////////////////////////////////////////// |
| 2646 | 2646 |
| 2647 /* | 2647 /* |
| 2648 * Handles initializing the UI when the page has finished loading. | 2648 * Handles initializing the UI when the page has finished loading. |
| 2649 */ | 2649 */ |
| 2650 window.addEventListener('DOMContentLoaded', function(evt) { | 2650 window.addEventListener('DOMContentLoaded', function(evt) { |
| 2651 ntp.init(); | 2651 ntp.init(); |
| 2652 $('content-area').style.display = 'block'; | 2652 $('content-area').style.display = 'block'; |
| 2653 }); | 2653 }); |
| OLD | NEW |