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 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 var openTabsList = new Array(); | 1789 var openTabsList = new Array(); |
1790 for (var winNum = 0; winNum < windows.length; winNum++) { | 1790 for (var winNum = 0; winNum < windows.length; winNum++) { |
1791 win = windows[winNum]; | 1791 win = windows[winNum]; |
1792 var tabs = win.tabs; | 1792 var tabs = win.tabs; |
1793 for (var tabNum = 0; tabNum < tabs.length; tabNum++) { | 1793 for (var tabNum = 0; tabNum < tabs.length; tabNum++) { |
1794 var tab = tabs[tabNum]; | 1794 var tab = tabs[tabNum]; |
1795 // If this is the last tab in the window and there are more windows, | 1795 // If this is the last tab in the window and there are more windows, |
1796 // use a section divider. | 1796 // use a section divider. |
1797 var needSectionDivider = | 1797 var needSectionDivider = |
1798 (tabNum + 1 == tabs.length) && (winNum + 1 < windows.length); | 1798 (tabNum + 1 == tabs.length) && (winNum + 1 < windows.length); |
| 1799 tab.icon = tab.icon || |
| 1800 'chrome://session-favicon/size/16@1x/' + tab.url; |
| 1801 |
1799 openTabsList.push({ | 1802 openTabsList.push({ |
1800 timestamp: tab.timestamp, | 1803 timestamp: tab.timestamp, |
1801 title: tab.title, | 1804 title: tab.title, |
1802 url: tab.url, | 1805 url: tab.url, |
1803 sessionTag: client.tag, | 1806 sessionTag: client.tag, |
1804 winNum: winNum, | 1807 winNum: winNum, |
1805 sessionId: tab.sessionId, | 1808 sessionId: tab.sessionId, |
1806 icon: tab.icon, | 1809 icon: tab.icon, |
1807 iconSize: 32, | 1810 iconSize: 16, |
1808 divider: needSectionDivider ? 'section' : 'standard', | 1811 divider: needSectionDivider ? 'section' : 'standard', |
1809 }); | 1812 }); |
1810 } | 1813 } |
1811 } | 1814 } |
1812 var tabCallback = function(item, evt) { | 1815 var tabCallback = function(item, evt) { |
1813 var buttonIndex = 0; | 1816 var buttonIndex = 0; |
1814 var altKeyPressed = false; | 1817 var altKeyPressed = false; |
1815 var ctrlKeyPressed = false; | 1818 var ctrlKeyPressed = false; |
1816 var metaKeyPressed = false; | 1819 var metaKeyPressed = false; |
1817 var shiftKeyPressed = false; | 1820 var shiftKeyPressed = false; |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 // NTP Entry point. | 2690 // NTP Entry point. |
2688 ///////////////////////////////////////////////////////////////////////////// | 2691 ///////////////////////////////////////////////////////////////////////////// |
2689 | 2692 |
2690 /* | 2693 /* |
2691 * Handles initializing the UI when the page has finished loading. | 2694 * Handles initializing the UI when the page has finished loading. |
2692 */ | 2695 */ |
2693 window.addEventListener('DOMContentLoaded', function(evt) { | 2696 window.addEventListener('DOMContentLoaded', function(evt) { |
2694 ntp.init(); | 2697 ntp.init(); |
2695 $('content-area').style.display = 'block'; | 2698 $('content-area').style.display = 'block'; |
2696 }); | 2699 }); |
OLD | NEW |