OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 6 /** |
7 * @fileoverview The local InstantExtended NTP. | 7 * @fileoverview The local InstantExtended NTP. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 return location.href.indexOf('isGoogle') != -1; | 847 return location.href.indexOf('isGoogle') != -1; |
848 } | 848 } |
849 | 849 |
850 | 850 |
851 /** | 851 /** |
852 * Prepares the New Tab Page by adding listeners, rendering the current | 852 * Prepares the New Tab Page by adding listeners, rendering the current |
853 * theme, the most visited pages section, and Google-specific elements for a | 853 * theme, the most visited pages section, and Google-specific elements for a |
854 * Google-provided page. | 854 * Google-provided page. |
855 */ | 855 */ |
856 function init() { | 856 function init() { |
857 document.title = templateData.title; | |
858 | |
859 tilesContainer = $(IDS.TILES); | 857 tilesContainer = $(IDS.TILES); |
860 notification = $(IDS.NOTIFICATION); | 858 notification = $(IDS.NOTIFICATION); |
861 attribution = $(IDS.ATTRIBUTION); | 859 attribution = $(IDS.ATTRIBUTION); |
862 ntpContents = $(IDS.NTP_CONTENTS); | 860 ntpContents = $(IDS.NTP_CONTENTS); |
863 | 861 |
864 for (var i = 0; i < NUM_ROWS; i++) { | 862 for (var i = 0; i < NUM_ROWS; i++) { |
865 var row = document.createElement('div'); | 863 var row = document.createElement('div'); |
866 row.classList.add(CLASSES.ROW); | 864 row.classList.add(CLASSES.ROW); |
867 tilesContainer.appendChild(row); | 865 tilesContainer.appendChild(row); |
868 } | 866 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 | 949 |
952 return { | 950 return { |
953 init: init, | 951 init: init, |
954 listen: listen | 952 listen: listen |
955 }; | 953 }; |
956 } | 954 } |
957 | 955 |
958 if (!window.localNTPUnitTest) { | 956 if (!window.localNTPUnitTest) { |
959 LocalNTP(location).listen(); | 957 LocalNTP(location).listen(); |
960 } | 958 } |
OLD | NEW |