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

Delta Between Two Patch Sets: safari/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 | « chrome/ext/background.js ('k') | no next file » | 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 }, 158 },
159 has: function(tab) 159 has: function(tab)
160 { 160 {
161 return this._indexOf(tab) != -1; 161 return this._indexOf(tab) != -1;
162 }, 162 },
163 clear: function() 163 clear: function()
164 { 164 {
165 while (this._data.length > 0) 165 while (this._data.length > 0)
166 this.delete(this._data[0].tab); 166 this.delete(this._data[0].tab);
167 } 167 },
168 }; 168 delete: function(tab)
169 TabMap.prototype["delete"] = function(tab) 169 {
170 { 170 var idx = this._indexOf(tab);
171 var idx = this._indexOf(tab); 171
172 172 if (idx != -1)
173 if (idx != -1) 173 {
174 { 174 tab = this._data[idx].tab;
175 tab = this._data[idx].tab; 175 this._data.splice(idx, 1);
176 this._data.splice(idx, 1); 176
177 177 tab.onRemoved.removeListener(this._delete);
178 tab.onRemoved.removeListener(this._delete); 178 tab.onLoading.removeListener(this.delete);
179 tab.onLoading.removeListener(this.delete); 179 }
180 } 180 }
181 }; 181 };
182 182
183 ext.tabs = { 183 ext.tabs = {
184 onLoading: new LoadingTabEventTarget(safari.application), 184 onLoading: new LoadingTabEventTarget(safari.application),
185 onCompleted: new TabEventTarget(safari.application, "navigate", true), 185 onCompleted: new TabEventTarget(safari.application, "navigate", true),
186 onActivated: new TabEventTarget(safari.application, "activate", true), 186 onActivated: new TabEventTarget(safari.application, "activate", true),
187 onRemoved: new TabEventTarget(safari.application, "close", true) 187 onRemoved: new TabEventTarget(safari.application, "close", true)
188 }; 188 };
189 189
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 for (var i = 0; i < contextMenuItems.length; i++) 706 for (var i = 0; i < contextMenuItems.length; i++)
707 { 707 {
708 if (contextMenuItems[i].id == event.command) 708 if (contextMenuItems[i].id == event.command)
709 { 709 {
710 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic ation.activeBrowserWindow.activeTab)); 710 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic ation.activeBrowserWindow.activeTab));
711 break; 711 break;
712 } 712 }
713 } 713 }
714 }, false); 714 }, false);
715 })(); 715 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld