Chromium Code Reviews| Index: chrome/browser/resources/ntp4/new_tab.js |
| diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js |
| index eef19f37bf44a60bd41ac3f3e88b106df83ab6a0..0065f2e4467159c132c3f20fb30762773052ded8 100644 |
| --- a/chrome/browser/resources/ntp4/new_tab.js |
| +++ b/chrome/browser/resources/ntp4/new_tab.js |
| @@ -117,6 +117,8 @@ cr.define('ntp', function() { |
| if (templateData.showOtherSessionsMenu) { |
| cr.ui.decorate($('other-sessions-menu-button'), |
| ntp.OtherSessionsMenuButton); |
| + $('other-sessions-menu-button').initialize( |
| + templateData.isUserSignedIn); |
| } |
| var mostVisited = new ntp.MostVisitedPage(); |
| @@ -157,7 +159,6 @@ cr.define('ntp', function() { |
| var url = appendParam(webstoreLink, 'utm_source', 'chrome-ntp-plus-icon'); |
| $('app-install-hint-template').href = url; |
| } |
| - |
|
Dan Beam
2012/03/26 20:42:39
nit: don't remove this \n
Patrick Dubroy
2012/03/26 21:41:47
Done.
|
| if (localStrings.getString('login_status_message')) { |
| loginBubble = new cr.ui.Bubble; |
| loginBubble.anchorNode = $('login-container'); |
| @@ -216,11 +217,7 @@ cr.define('ntp', function() { |
| } |
| var loginContainer = getRequiredElement('login-container'); |
| - loginContainer.addEventListener('click', function() { |
| - var rect = loginContainer.getBoundingClientRect(); |
| - chrome.send('showSyncLoginUI', |
| - [rect.left, rect.top, rect.width, rect.height]); |
| - }); |
| + loginContainer.addEventListener('click', showSyncLoginUI); |
| chrome.send('initializeSyncLogin'); |
| doWhenAllSectionsReady(function() { |
| @@ -497,8 +494,9 @@ cr.define('ntp', function() { |
| * @param {string} loginSubHeader The second line of text. |
| * @param {string} iconURL The url for the login status icon. If this is null |
| then the login status icon is hidden. |
| + * @param {boolean} isUserSignedIn Indicates if the user is signed in or not. |
| */ |
| - function updateLogin(loginHeader, loginSubHeader, iconURL) { |
| + function updateLogin(loginHeader, loginSubHeader, iconURL, isUserSignedIn) { |
| if (loginHeader || loginSubHeader) { |
| $('login-container').hidden = false; |
| $('login-status-header').innerHTML = loginHeader; |
| @@ -524,6 +522,17 @@ cr.define('ntp', function() { |
| } else if (loginBubble) { |
| loginBubble.reposition(); |
| } |
| + $('other-sessions-menu-button').updateSignInState(isUserSignedIn); |
| + } |
| + |
| + /** |
| + * Show the sync login UI. |
| + * @param {Event} e The click event. |
| + */ |
| + function showSyncLoginUI(e) { |
| + var rect = e.currentTarget.getBoundingClientRect(); |
| + chrome.send('showSyncLoginUI', |
| + [rect.left, rect.top, rect.width, rect.height]); |
| } |
| /** |