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 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 | 1736 |
1737 // Set up the container for the session children | 1737 // Set up the container for the session children |
1738 var sessionChildren = createDiv('session-children-container'); | 1738 var sessionChildren = createDiv('session-children-container'); |
1739 sessionEl.appendChild(sessionChildren); | 1739 sessionEl.appendChild(sessionChildren); |
1740 | 1740 |
1741 var clientName = 'Client ' + clientNum; | 1741 var clientName = 'Client ' + clientNum; |
1742 if (client.name) | 1742 if (client.name) |
1743 clientName = client.name; | 1743 clientName = client.name; |
1744 | 1744 |
1745 var iconStyle; | 1745 var iconStyle; |
1746 if (windows[0].deviceType == 'win' || | 1746 var deviceType = client.deviceType; |
1747 windows[0].deviceType == 'macosx' || | 1747 if (deviceType == 'win' || |
1748 windows[0].deviceType == 'linux' || | 1748 deviceType == 'macosx' || |
1749 windows[0].deviceType == 'chromeos' || | 1749 deviceType == 'linux' || |
1750 windows[0].deviceType == 'other') { | 1750 deviceType == 'chromeos' || |
| 1751 deviceType == 'other') { |
1751 iconStyle = 'laptop'; | 1752 iconStyle = 'laptop'; |
1752 } else if (windows[0].deviceType == 'phone') { | 1753 } else if (deviceType == 'phone') { |
1753 iconStyle = 'phone'; | 1754 iconStyle = 'phone'; |
1754 } else if (windows[0].deviceType == 'tablet') { | 1755 } else if (deviceType == 'tablet') { |
1755 iconStyle = 'tablet'; | 1756 iconStyle = 'tablet'; |
1756 } else { | 1757 } else { |
1757 console.error( | 1758 console.error('Unknown sync device type found: ', deviceType); |
1758 'Unknown sync device type found: ', windows[0].deviceType); | |
1759 iconStyle = 'laptop'; | 1759 iconStyle = 'laptop'; |
1760 } | 1760 } |
1761 var headerList = [{ | 1761 var headerList = [{ |
1762 'title': clientName, | 1762 'title': clientName, |
1763 'userVisibleTimestamp': windows[0].userVisibleTimestamp, | 1763 'userVisibleTimestamp': windows[0].userVisibleTimestamp, |
1764 'iconStyle': iconStyle, | 1764 'iconStyle': iconStyle, |
1765 'sessionTag': client.tag, | 1765 'sessionTag': client.tag, |
1766 }]; | 1766 }]; |
1767 | 1767 |
1768 var expando = createDiv(); | 1768 var expando = createDiv(); |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 // NTP Entry point. | 2660 // NTP Entry point. |
2661 ///////////////////////////////////////////////////////////////////////////// | 2661 ///////////////////////////////////////////////////////////////////////////// |
2662 | 2662 |
2663 /* | 2663 /* |
2664 * Handles initializing the UI when the page has finished loading. | 2664 * Handles initializing the UI when the page has finished loading. |
2665 */ | 2665 */ |
2666 window.addEventListener('DOMContentLoaded', function(evt) { | 2666 window.addEventListener('DOMContentLoaded', function(evt) { |
2667 ntp.init(); | 2667 ntp.init(); |
2668 $('content-area').style.display = 'block'; | 2668 $('content-area').style.display = 'block'; |
2669 }); | 2669 }); |
OLD | NEW |