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

Unified Diff: chrome/browser/resources/ntp/most_visited.js

Issue 3315005: NTP: Adds a context menu to the apps section... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/resources/shared/css/menu.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp/most_visited.js
===================================================================
--- chrome/browser/resources/ntp/most_visited.js (revision 58563)
+++ chrome/browser/resources/ntp/most_visited.js (working copy)
@@ -56,6 +56,10 @@
document.addEventListener('DOMContentLoaded',
bind(this.ensureSmallGridCorrect, this));
+ // Commands
+ document.addEventListener('command', bind(this.handleCommand_, this));
+ document.addEventListener('canExecute', bind(this.handleCanExecute_, this));
+
// DND
el.addEventListener('dragstart', bind(this.handleDragStart_, this));
el.addEventListener('dragenter', bind(this.handleDragEnter_, this));
@@ -300,6 +304,23 @@
return this.getMostVisitedLayoutRects_()[index];
},
+ // Commands
+
+ handleCommand_: function(e) {
+ var commandId = e.command.id;
+ switch (commandId) {
+ case 'clear-all-blacklisted':
+ this.clearAllBlacklisted();
+ chrome.send('getMostVisited');
+ break;
+ }
+ },
+
+ handleCanExecute_: function(e) {
+ if (e.command.id == 'clear-all-blacklisted')
+ e.canExecute = true;
+ },
+
// DND
currentOverItem_: null,
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/browser/resources/shared/css/menu.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698