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

Side by Side Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 7713026: [ntp4] Observe and process bookmark change notifications from the bookmarks data model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review changes; rebase Created 9 years, 4 months 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
OLDNEW
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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 * Store the app page name into the preferences store. 729 * Store the app page name into the preferences store.
730 * @param {AppsPage} appPage The app page for which we wish to save. 730 * @param {AppsPage} appPage The app page for which we wish to save.
731 * @param {string} name The name of the page. 731 * @param {string} name The name of the page.
732 */ 732 */
733 function saveAppPageName(appPage, name) { 733 function saveAppPageName(appPage, name) {
734 var index = getAppsPageIndex(appPage); 734 var index = getAppsPageIndex(appPage);
735 assert(index != -1); 735 assert(index != -1);
736 chrome.send('saveAppPageName', [name, index]); 736 chrome.send('saveAppPageName', [name, index]);
737 } 737 }
738 738
739 function bookmarkImportBegan() {
740 bookmarksPage.bookmarkImportBegan();
741 };
742
743 function bookmarkImportEnded() {
744 bookmarksPage.bookmarkImportEnded();
745 };
746
747 function bookmarkNodeAdded(id, bookmark) {
748 bookmarksPage.bookmarkNodeAdded(id, bookmark);
749 };
750
751 function bookmarkNodeChanged(id, changeInfo) {
752 bookmarksPage.bookmarkNodeChanged(id, changeInfo);
753 };
754
755 function bookmarkNodeChildrenReordered(id, reorderInfo) {
756 bookmarksPage.bookmarkNodeChildrenReordered(id, reorderInfo);
757 };
758
759 function bookmarkNodeMoved(id, moveInfo) {
760 bookmarksPage.bookmarkNodeMoved(id, moveInfo);
761 };
762
763 function bookmarkNodeRemoved(id, removeInfo) {
764 bookmarksPage.bookmarkNodeRemoved(id, removeInfo);
765 };
766
739 // Return an object with all the exports 767 // Return an object with all the exports
740 return { 768 return {
741 appAdded: appAdded, 769 appAdded: appAdded,
742 appRemoved: appRemoved, 770 appRemoved: appRemoved,
743 appsPrefChangeCallback: appsPrefChangeCallback, 771 appsPrefChangeCallback: appsPrefChangeCallback,
744 assert: assert, 772 assert: assert,
773 bookmarkImportBegan: bookmarkImportBegan,
774 bookmarkImportEnded: bookmarkImportEnded,
775 bookmarkNodeAdded: bookmarkNodeAdded,
776 bookmarkNodeChanged: bookmarkNodeChanged,
777 bookmarkNodeChildrenReordered: bookmarkNodeChildrenReordered,
778 bookmarkNodeMoved: bookmarkNodeMoved,
779 bookmarkNodeRemoved: bookmarkNodeRemoved,
745 enterRearrangeMode: enterRearrangeMode, 780 enterRearrangeMode: enterRearrangeMode,
746 getAppsCallback: getAppsCallback, 781 getAppsCallback: getAppsCallback,
747 getAppsPageIndex: getAppsPageIndex, 782 getAppsPageIndex: getAppsPageIndex,
748 getCardSlider: getCardSlider, 783 getCardSlider: getCardSlider,
749 initialize: initialize, 784 initialize: initialize,
750 isRTL: isRTL, 785 isRTL: isRTL,
751 leaveRearrangeMode: leaveRearrangeMode, 786 leaveRearrangeMode: leaveRearrangeMode,
752 saveAppPageName: saveAppPageName, 787 saveAppPageName: saveAppPageName,
753 setBookmarksData: setBookmarksData, 788 setBookmarksData: setBookmarksData,
754 setMostVisitedPages: setMostVisitedPages, 789 setMostVisitedPages: setMostVisitedPages,
755 setRecentlyClosedTabs: setRecentlyClosedTabs, 790 setRecentlyClosedTabs: setRecentlyClosedTabs,
756 showNotification: showNotification, 791 showNotification: showNotification,
757 themeChanged: themeChanged 792 themeChanged: themeChanged
758 }; 793 };
759 }); 794 });
760 795
761 // publish ntp globals 796 // publish ntp globals
762 // TODO(estade): update the content handlers to use ntp namespace instead of 797 // TODO(estade): update the content handlers to use ntp namespace instead of
763 // making these global. 798 // making these global.
764 var assert = ntp4.assert; 799 var assert = ntp4.assert;
765 var getAppsCallback = ntp4.getAppsCallback; 800 var getAppsCallback = ntp4.getAppsCallback;
766 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 801 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
767 var themeChanged = ntp4.themeChanged; 802 var themeChanged = ntp4.themeChanged;
768 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 803 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
769 var setMostVisitedPages = ntp4.setMostVisitedPages; 804 var setMostVisitedPages = ntp4.setMostVisitedPages;
770 805
771 document.addEventListener('DOMContentLoaded', ntp4.initialize); 806 document.addEventListener('DOMContentLoaded', ntp4.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698