From 3ed462685a542d3a9625d8fa24a5755a283530ae Mon Sep 17 00:00:00 2001 From: "arv@chromium.org" Date: Mon, 13 Sep 2010 23:47:06 +0000 Subject: DOMUI etc. Use the built in bind method of Function now that V8 supports it. BUG=None TEST=None Review URL: http://codereview.chromium.org/3308030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59303 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/ntp/most_visited.js | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'chrome/browser/resources/ntp/most_visited.js') diff --git a/chrome/browser/resources/ntp/most_visited.js b/chrome/browser/resources/ntp/most_visited.js index bff2c1f..5b024b2 100644 --- a/chrome/browser/resources/ntp/most_visited.js +++ b/chrome/browser/resources/ntp/most_visited.js @@ -50,25 +50,25 @@ var MostVisited = (function() { this.createThumbnails_(); this.applyMostVisitedRects_(); - el.addEventListener('click', bind(this.handleClick_, this)); - el.addEventListener('keydown', bind(this.handleKeyDown_, this)); + el.addEventListener('click', this.handleClick_.bind(this)); + el.addEventListener('keydown', this.handleKeyDown_.bind(this)); document.addEventListener('DOMContentLoaded', - bind(this.ensureSmallGridCorrect, this)); + this.ensureSmallGridCorrect.bind(this)); // Commands - document.addEventListener('command', bind(this.handleCommand_, this)); - document.addEventListener('canExecute', bind(this.handleCanExecute_, this)); + document.addEventListener('command', this.handleCommand_.bind(this)); + document.addEventListener('canExecute', this.handleCanExecute_.bind(this)); // DND - el.addEventListener('dragstart', bind(this.handleDragStart_, this)); - el.addEventListener('dragenter', bind(this.handleDragEnter_, this)); - el.addEventListener('dragover', bind(this.handleDragOver_, this)); - el.addEventListener('dragleave', bind(this.handleDragLeave_, this)); - el.addEventListener('drop', bind(this.handleDrop_, this)); - el.addEventListener('dragend', bind(this.handleDragEnd_, this)); - el.addEventListener('drag', bind(this.handleDrag_, this)); - el.addEventListener('mousedown', bind(this.handleMouseDown_, this)); + el.addEventListener('dragstart', this.handleDragStart_.bind(this)); + el.addEventListener('dragenter', this.handleDragEnter_.bind(this)); + el.addEventListener('dragover', this.handleDragOver_.bind(this)); + el.addEventListener('dragleave', this.handleDragLeave_.bind(this)); + el.addEventListener('drop', this.handleDrop_.bind(this)); + el.addEventListener('dragend', this.handleDragEnd_.bind(this)); + el.addEventListener('drag', this.handleDrag_.bind(this)); + el.addEventListener('mousedown', this.handleMouseDown_.bind(this)); } MostVisited.prototype = { @@ -418,10 +418,10 @@ var MostVisited = (function() { // The timeout below is to allow WebKit to see that we turned off // pointer-event before moving the thumbnails so that we can get out of // hover mode. - window.setTimeout(bind(function() { + window.setTimeout((function() { this.invalidate_(); this.layout(); - }, this), 10); + }).bind(this), 10); e.preventDefault(); if (this.dragEndTimer_) { window.clearTimeout(this.dragEndTimer_); -- cgit v1.1