Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(784)

Side by Side Diff: chrome/browser/resources/new_new_tab.js

Issue 462011: Notify user that Chrome is already synced if promo banner "sync me" link is c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/ntp_resource_cache.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Helpers 2 // Helpers
3 3
4 // TODO(arv): Remove these when classList is available in HTML5. 4 // TODO(arv): Remove these when classList is available in HTML5.
5 // https://bugs.webkit.org/show_bug.cgi?id=20709 5 // https://bugs.webkit.org/show_bug.cgi?id=20709
6 function hasClass(el, name) { 6 function hasClass(el, name) {
7 return el.nodeType == 1 && el.className.split(/\s+/).indexOf(name) != -1; 7 return el.nodeType == 1 && el.className.split(/\s+/).indexOf(name) != -1;
8 } 8 }
9 9
10 function addClass(el, name) { 10 function addClass(el, name) {
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 682
683 /** 683 /**
684 * Invoked when the link in the sync status section is clicked. 684 * Invoked when the link in the sync status section is clicked.
685 */ 685 */
686 function syncSectionLinkClicked(e) { 686 function syncSectionLinkClicked(e) {
687 chrome.send('SyncLinkClicked'); 687 chrome.send('SyncLinkClicked');
688 e.preventDefault(); 688 e.preventDefault();
689 } 689 }
690 690
691 /** 691 /**
692 * Invoked when link to start sync in the promo message is clicked, and Chrome
693 * has already been synced to an account.
694 */
695 function syncAlreadyEnabled(message) {
696 showNotification(message.syncEnabledMessage,
697 localStrings.getString('close'));
698 }
699
700 /**
692 * Returns the text used for a recently closed window. 701 * Returns the text used for a recently closed window.
693 * @param {number} numTabs Number of tabs in the window. 702 * @param {number} numTabs Number of tabs in the window.
694 * @return {string} The text to use. 703 * @return {string} The text to use.
695 */ 704 */
696 function formatTabsText(numTabs) { 705 function formatTabsText(numTabs) {
697 if (numTabs == 1) 706 if (numTabs == 1)
698 return localStrings.getString('closedwindowsingle'); 707 return localStrings.getString('closedwindowsingle');
699 return localStrings.formatString('closedwindowmultiple', numTabs); 708 return localStrings.formatString('closedwindowmultiple', numTabs);
700 } 709 }
701 710
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 syncButton.onclick = syncSectionLinkClicked; 1643 syncButton.onclick = syncSectionLinkClicked;
1635 fixLinkUnderlines($('promo-message')); 1644 fixLinkUnderlines($('promo-message'));
1636 } 1645 }
1637 1646
1638 // A Windows-specific Webkit bug adds padding to buttons and will push the 1647 // A Windows-specific Webkit bug adds padding to buttons and will push the
1639 // bookmark sync button in the promo message too far to the right unless we 1648 // bookmark sync button in the promo message too far to the right unless we
1640 // use this fix. See https://bugs.webkit.org/show_bug.cgi?id=31703 1649 // use this fix. See https://bugs.webkit.org/show_bug.cgi?id=31703
1641 if (navigator.platform == 'Win32') { 1650 if (navigator.platform == 'Win32') {
1642 addClass(document.body, 'win-button-padding-bug'); 1651 addClass(document.body, 'win-button-padding-bug');
1643 } 1652 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/ntp_resource_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698