Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: chrome/ext/background.js

Issue 5735785512828928: Remove tabs from TabMap onLoading instead of onBeforeNavigate on Safari (Closed)
Left Patch Set: Addressed comments Created Jan. 23, 2014, 1:50 p.m.
Right Patch Set: Apparently you can used the reserved keyword "delete" as key when defining inline objects Created Jan. 23, 2014, 3:24 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | safari/ext/background.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 }, 316 },
317 clear: function() 317 clear: function()
318 { 318 {
319 for (var id in this._map) 319 for (var id in this._map)
320 this.delete(this._map[id].tab); 320 this.delete(this._map[id].tab);
321 }, 321 },
322 _delete: function(tab) 322 _delete: function(tab)
323 { 323 {
324 // delay so that other event handlers can still lookup this tab 324 // delay so that other event handlers can still lookup this tab
325 setTimeout(this.delete.bind(this, tab), 0); 325 setTimeout(this.delete.bind(this, tab), 0);
326 } 326 },
327 }; 327 delete: function(tab)
328 TabMap.prototype["delete"] = function(tab) 328 {
329 { 329 delete this._map[tab._id];
330 delete this._map[tab._id]; 330
331 331 tab.onRemoved.removeListener(this._delete);
332 tab.onRemoved.removeListener(this._delete); 332 tab._onBeforeNavigate.removeListener(this._delete);
333 tab._onBeforeNavigate.removeListener(this._delete); 333 }
334 }; 334 };
335 335
336 336
337 /* Windows */ 337 /* Windows */
338 338
339 Window = function(win) 339 Window = function(win)
340 { 340 {
341 this._id = win.id; 341 this._id = win.id;
342 this.visible = win.status != "minimized"; 342 this.visible = win.status != "minimized";
343 }; 343 };
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (isContextMenuHidden) 577 if (isContextMenuHidden)
578 return; 578 return;
579 579
580 chrome.contextMenus.removeAll(); 580 chrome.contextMenus.removeAll();
581 isContextMenuHidden = true; 581 isContextMenuHidden = true;
582 } 582 }
583 }; 583 };
584 584
585 ext.onMessage = new BackgroundMessageEventTarget(); 585 ext.onMessage = new BackgroundMessageEventTarget();
586 })(); 586 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld