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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 loginBubble.content = bubbleContent; | 186 loginBubble.content = bubbleContent; |
187 | 187 |
188 // The anchor node won't be updated until updateLogin is called so don't | 188 // The anchor node won't be updated until updateLogin is called so don't |
189 // show the bubble yet. | 189 // show the bubble yet. |
190 shouldShowLoginBubble = true; | 190 shouldShowLoginBubble = true; |
191 } | 191 } |
192 | 192 |
193 if (loadTimeData.valueExists('bubblePromoText')) { | 193 if (loadTimeData.valueExists('bubblePromoText')) { |
194 promoBubble = new cr.ui.Bubble; | 194 promoBubble = new cr.ui.Bubble; |
195 promoBubble.anchorNode = getRequiredElement('logo-img'); | 195 promoBubble.anchorNode = getRequiredElement('logo-img'); |
196 promoBubble.setArrowLocation(cr.ui.ArrowLocation.BOTTOM_START); | 196 promoBubble.arrowLocation = cr.ui.ArrowLocation.BOTTOM_START; |
197 promoBubble.bubbleAlignment = | 197 promoBubble.bubbleAlignment = |
198 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; | 198 cr.ui.BubbleAlignment.BUBBLE_EDGE_TO_ANCHOR_EDGE; |
199 promoBubble.deactivateToDismissDelay = 2000; | 199 promoBubble.deactivateToDismissDelay = 2000; |
200 promoBubble.content = parseHtmlSubset(loadTimeData.getString( | 200 promoBubble.content = parseHtmlSubset(loadTimeData.getString( |
201 'bubblePromoText'), ['BR']); | 201 'bubblePromoText'), ['BR']); |
202 promoBubble.handleCloseEvent = function() { | 202 promoBubble.handleCloseEvent = function() { |
203 promoBubble.hide(); | 203 promoBubble.hide(); |
204 chrome.send('bubblePromoClosed'); | 204 chrome.send('bubblePromoClosed'); |
205 }; | 205 }; |
206 promoBubble.show(); | 206 promoBubble.show(); |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 setFaviconDominantColor: setFaviconDominantColor, | 625 setFaviconDominantColor: setFaviconDominantColor, |
626 showNotification: showNotification, | 626 showNotification: showNotification, |
627 themeChanged: themeChanged, | 627 themeChanged: themeChanged, |
628 updateLogin: updateLogin | 628 updateLogin: updateLogin |
629 }; | 629 }; |
630 }); | 630 }); |
631 | 631 |
632 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 632 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
633 | 633 |
634 var toCssPx = cr.ui.toCssPx; | 634 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |