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 $('chrome-web-store-link').style.display = 'none'; |
Joao da Silva
2013/01/18 14:02:50
I think $('chrome-web-store-link').hidden = true;
dconnelly
2013/01/18 17:26:20
I actually think removing the element from the DOM
Joao da Silva
2013/01/21 07:44:50
SGTM but I'd wait for Evan's approval on this :-)
| |
167 $('chrome-web-store-link').href = url; | 167 } else { |
168 $('chrome-web-store-link').addEventListener('click', | 168 var webStoreLink = loadTimeData.getString('webStoreLink'); |
169 onChromeWebStoreButtonClick); | 169 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); |
170 $('chrome-web-store-link').href = url; | |
171 $('chrome-web-store-link').addEventListener('click', | |
172 onChromeWebStoreButtonClick); | |
173 } | |
170 | 174 |
171 if (loadTimeData.getString('login_status_message')) { | 175 if (loadTimeData.getString('login_status_message')) { |
172 loginBubble = new cr.ui.Bubble; | 176 loginBubble = new cr.ui.Bubble; |
173 loginBubble.anchorNode = $('login-container'); | 177 loginBubble.anchorNode = $('login-container'); |
174 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; | 178 loginBubble.arrowLocation = cr.ui.ArrowLocation.TOP_END; |
175 loginBubble.bubbleAlignment = | 179 loginBubble.bubbleAlignment = |
176 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; | 180 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; |
177 loginBubble.deactivateToDismissDelay = 2000; | 181 loginBubble.deactivateToDismissDelay = 2000; |
178 loginBubble.closeButtonVisible = false; | 182 loginBubble.closeButtonVisible = false; |
179 | 183 |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 setFaviconDominantColor: setFaviconDominantColor, | 645 setFaviconDominantColor: setFaviconDominantColor, |
642 showNotification: showNotification, | 646 showNotification: showNotification, |
643 themeChanged: themeChanged, | 647 themeChanged: themeChanged, |
644 updateLogin: updateLogin | 648 updateLogin: updateLogin |
645 }; | 649 }; |
646 }); | 650 }); |
647 | 651 |
648 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 652 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
649 | 653 |
650 var toCssPx = cr.ui.toCssPx; | 654 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |