| 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 /** | 5 /** |
| 6 * @fileoverview New tab page | 6 * @fileoverview New tab page |
| 7 * This is the main code for the new tab page used by touch-enabled Chrome | 7 * This is the main code for the new tab page used by touch-enabled Chrome |
| 8 * browsers. For now this is still a prototype. | 8 * browsers. For now this is still a prototype. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 loadTimeData.getString('suggestions'), | 155 loadTimeData.getString('suggestions'), |
| 156 false, | 156 false, |
| 157 (newTabView.appsPages.length > 0) ? | 157 (newTabView.appsPages.length > 0) ? |
| 158 newTabView.appsPages[0] : null); | 158 newTabView.appsPages[0] : null); |
| 159 chrome.send('getSuggestions'); | 159 chrome.send('getSuggestions'); |
| 160 cr.dispatchSimpleEvent(document, 'sectionready', true, true); | 160 cr.dispatchSimpleEvent(document, 'sectionready', true, true); |
| 161 }; | 161 }; |
| 162 document.querySelector('head').appendChild(suggestions_script); | 162 document.querySelector('head').appendChild(suggestions_script); |
| 163 } | 163 } |
| 164 | 164 |
| 165 var webStoreLink = loadTimeData.getString('webStoreLink'); | 165 if (loadTimeData.getBoolean('isWebStoreIconHidden')) { |
| 166 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); | 166 var webStoreIcon = $('chrome-web-store-link'); |
| 167 $('chrome-web-store-link').href = url; | 167 // The next NTP has no footer. |
| 168 $('chrome-web-store-link').addEventListener('click', | 168 if (webStoreIcon) |
| 169 onChromeWebStoreButtonClick); | 169 webStoreIcon.parentNode.removeChild(webStoreIcon); |
| 170 } else { |
| 171 var webStoreLink = loadTimeData.getString('webStoreLink'); |
| 172 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); |
| 173 $('chrome-web-store-link').href = url; |
| 174 $('chrome-web-store-link').addEventListener('click', |
| 175 onChromeWebStoreButtonClick); |
| 176 } |
| 170 | 177 |
| 171 if (loadTimeData.getString('login_status_message')) { | 178 if (loadTimeData.getString('login_status_message')) { |
| 172 loginBubble = new cr.ui.Bubble; | 179 loginBubble = new cr.ui.Bubble; |
| 173 loginBubble.anchorNode = $('login-container'); | 180 loginBubble.anchorNode = $('login-container'); |
| 174 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; | 181 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; |
| 175 loginBubble.bubbleAlignment = | 182 loginBubble.bubbleAlignment = |
| 176 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; | 183 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; |
| 177 loginBubble.deactivateToDismissDelay = 2000; | 184 loginBubble.deactivateToDismissDelay = 2000; |
| 178 loginBubble.closeButtonVisible = false; | 185 loginBubble.closeButtonVisible = false; |
| 179 | 186 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 setFaviconDominantColor: setFaviconDominantColor, | 648 setFaviconDominantColor: setFaviconDominantColor, |
| 642 showNotification: showNotification, | 649 showNotification: showNotification, |
| 643 themeChanged: themeChanged, | 650 themeChanged: themeChanged, |
| 644 updateLogin: updateLogin | 651 updateLogin: updateLogin |
| 645 }; | 652 }; |
| 646 }); | 653 }); |
| 647 | 654 |
| 648 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 655 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 649 | 656 |
| 650 var toCssPx = cr.ui.toCssPx; | 657 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |