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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 loadTimeData.getString('suggestions'), | 163 loadTimeData.getString('suggestions'), |
164 false, | 164 false, |
165 (newTabView.appsPages.length > 0) ? | 165 (newTabView.appsPages.length > 0) ? |
166 newTabView.appsPages[0] : null); | 166 newTabView.appsPages[0] : null); |
167 chrome.send('getSuggestions'); | 167 chrome.send('getSuggestions'); |
168 cr.dispatchSimpleEvent(document, 'sectionready', true, true); | 168 cr.dispatchSimpleEvent(document, 'sectionready', true, true); |
169 }; | 169 }; |
170 document.querySelector('head').appendChild(suggestions_script); | 170 document.querySelector('head').appendChild(suggestions_script); |
171 } | 171 } |
172 | 172 |
173 var webStoreLink = loadTimeData.getString('webStoreLink'); | 173 if (loadTimeData.getBoolean('isWebStoreIconHidden')) { |
174 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); | 174 var webStoreIcon = $('chrome-web-store-link'); |
175 $('chrome-web-store-link').href = url; | 175 // The next NTP has no footer. |
Evan Stade
2013/02/13 22:40:08
"Next" isn't very descriptive since its definition
dconnelly
2013/02/14 10:26:58
Done.
| |
176 $('chrome-web-store-link').addEventListener('click', | 176 if (webStoreIcon) |
177 onChromeWebStoreButtonClick); | 177 webStoreIcon.classList.add('invisible'); |
178 } else { | |
179 var webStoreLink = loadTimeData.getString('webStoreLink'); | |
180 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); | |
181 $('chrome-web-store-link').href = url; | |
182 $('chrome-web-store-link').addEventListener('click', | |
183 onChromeWebStoreButtonClick); | |
184 } | |
178 | 185 |
179 if (loadTimeData.getString('login_status_message')) { | 186 if (loadTimeData.getString('login_status_message')) { |
180 loginBubble = new cr.ui.Bubble; | 187 loginBubble = new cr.ui.Bubble; |
181 loginBubble.anchorNode = $('login-container'); | 188 loginBubble.anchorNode = $('login-container'); |
182 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; | 189 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; |
183 loginBubble.bubbleAlignment = | 190 loginBubble.bubbleAlignment = |
184 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; | 191 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; |
185 loginBubble.deactivateToDismissDelay = 2000; | 192 loginBubble.deactivateToDismissDelay = 2000; |
186 loginBubble.closeButtonVisible = false; | 193 loginBubble.closeButtonVisible = false; |
187 | 194 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
652 themeChanged: themeChanged, | 659 themeChanged: themeChanged, |
653 updateLogin: updateLogin | 660 updateLogin: updateLogin |
654 }; | 661 }; |
655 }); | 662 }); |
656 | 663 |
657 // This will end up calling ntp.gotShouldShowApps. | 664 // This will end up calling ntp.gotShouldShowApps. |
658 chrome.send('getShouldShowApps'); | 665 chrome.send('getShouldShowApps'); |
659 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 666 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
660 | 667 |
661 var toCssPx = cr.ui.toCssPx; | 668 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |