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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 * Updates the text displayed in the login container. If there is no text then | 921 * Updates the text displayed in the login container. If there is no text then |
922 * the login container is hidden. | 922 * the login container is hidden. |
923 * @param {string} loginHeader The first line of text. | 923 * @param {string} loginHeader The first line of text. |
924 * @param {string} loginSubHeader The second line of text. | 924 * @param {string} loginSubHeader The second line of text. |
925 */ | 925 */ |
926 function updateLogin(loginHeader, loginSubHeader) { | 926 function updateLogin(loginHeader, loginSubHeader) { |
927 if (loginHeader || loginSubHeader) { | 927 if (loginHeader || loginSubHeader) { |
928 $('login-container').hidden = false; | 928 $('login-container').hidden = false; |
929 $('login-status-header').innerHTML = loginHeader; | 929 $('login-status-header').innerHTML = loginHeader; |
930 $('login-status-sub-header').innerHTML = loginSubHeader; | 930 $('login-status-sub-header').innerHTML = loginSubHeader; |
| 931 $('card-slider-frame').classList.add('showing-login-area'); |
931 } else { | 932 } else { |
932 $('login-container').hidden = true; | 933 $('login-container').hidden = true; |
| 934 $('card-slider-frame').classList.remove('showing-login-area'); |
933 } | 935 } |
934 } | 936 } |
935 | 937 |
936 // Return an object with all the exports | 938 // Return an object with all the exports |
937 return { | 939 return { |
938 appAdded: appAdded, | 940 appAdded: appAdded, |
939 appRemoved: appRemoved, | 941 appRemoved: appRemoved, |
940 appsPrefChangeCallback: appsPrefChangeCallback, | 942 appsPrefChangeCallback: appsPrefChangeCallback, |
941 assert: assert, | 943 assert: assert, |
942 bookmarkImportBegan: bookmarkImportBegan, | 944 bookmarkImportBegan: bookmarkImportBegan, |
(...skipping 30 matching lines...) Expand all Loading... |
973 var getAppsCallback = ntp4.getAppsCallback; | 975 var getAppsCallback = ntp4.getAppsCallback; |
974 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 976 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
975 var themeChanged = ntp4.themeChanged; | 977 var themeChanged = ntp4.themeChanged; |
976 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 978 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
977 var setMostVisitedPages = ntp4.setMostVisitedPages; | 979 var setMostVisitedPages = ntp4.setMostVisitedPages; |
978 var updateLogin = ntp4.updateLogin; | 980 var updateLogin = ntp4.updateLogin; |
979 | 981 |
980 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 982 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
981 window.addEventListener('online', ntp4.updateOfflineEnabledApps); | 983 window.addEventListener('online', ntp4.updateOfflineEnabledApps); |
982 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); | 984 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); |
OLD | NEW |