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 /** | 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 */ | 440 */ |
441 function appendAppsPage(page, title) { | 441 function appendAppsPage(page, title) { |
442 pageList.insertBefore(page, bookmarksPage); | 442 pageList.insertBefore(page, bookmarksPage); |
443 | 443 |
444 // Make a deep copy of the dot template to add a new one. | 444 // Make a deep copy of the dot template to add a new one. |
445 var animate = page.classList.contains('temporary'); | 445 var animate = page.classList.contains('temporary'); |
446 var newDot = new ntp4.NavDot(page, title, true, animate); | 446 var newDot = new ntp4.NavDot(page, title, true, animate); |
447 | 447 |
448 dotList.insertBefore(newDot, bookmarksPage.navigationDot); | 448 dotList.insertBefore(newDot, bookmarksPage.navigationDot); |
449 page.navigationDot = newDot; | 449 page.navigationDot = newDot; |
| 450 if (infoBubble) |
| 451 window.setTimeout(infoBubble.reposition.bind(infoBubble), 0); |
450 | 452 |
451 eventTracker.add(page, 'pagelayout', onPageLayout); | 453 eventTracker.add(page, 'pagelayout', onPageLayout); |
452 } | 454 } |
453 | 455 |
454 /** | 456 /** |
455 * Search an elements ancestor chain for the nearest element that is a member | 457 * Search an elements ancestor chain for the nearest element that is a member |
456 * of the specified class. | 458 * of the specified class. |
457 * @param {!Element} element The element to start searching from. | 459 * @param {!Element} element The element to start searching from. |
458 * @param {string} className The name of the class to locate. | 460 * @param {string} className The name of the class to locate. |
459 * @return {Element} The first ancestor of the specified class or null. | 461 * @return {Element} The first ancestor of the specified class or null. |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 // TODO(estade): update the content handlers to use ntp namespace instead of | 740 // TODO(estade): update the content handlers to use ntp namespace instead of |
739 // making these global. | 741 // making these global. |
740 var assert = ntp4.assert; | 742 var assert = ntp4.assert; |
741 var getAppsCallback = ntp4.getAppsCallback; | 743 var getAppsCallback = ntp4.getAppsCallback; |
742 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 744 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
743 var themeChanged = ntp4.themeChanged; | 745 var themeChanged = ntp4.themeChanged; |
744 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 746 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
745 var setMostVisitedPages = ntp4.setMostVisitedPages; | 747 var setMostVisitedPages = ntp4.setMostVisitedPages; |
746 | 748 |
747 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 749 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
OLD | NEW |