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

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

Issue 5099207639695360: Made browser actions per tab on Safari (Closed)
Left Patch Set: Addressed comments Created Jan. 17, 2014, 12:31 p.m.
Right Patch Set: Forgot to set tab in BrowserAction constructor Created Jan. 17, 2014, 2:19 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 | « 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 { 208 {
209 var toolbarItem = safari.extension.toolbarItems[i]; 209 var toolbarItem = safari.extension.toolbarItems[i];
210 210
211 if (toolbarItem.browserWindow == win) 211 if (toolbarItem.browserWindow == win)
212 return toolbarItem; 212 return toolbarItem;
213 } 213 }
214 214
215 return null; 215 return null;
216 }; 216 };
217 217
218 var BrowserAction = function() {}; 218 var BrowserAction = function(tab)
219 {
220 this._tab = tab;
221 };
219 BrowserAction.prototype = { 222 BrowserAction.prototype = {
220 _set: function(name, value) 223 _set: function(name, value)
221 { 224 {
222 var currentWindow = this._tab._tab.browserWindow; 225 var currentWindow = this._tab._tab.browserWindow;
223 var toolbarItem = getToolbarItemForWindow(currentWindow); 226 var toolbarItem = getToolbarItemForWindow(currentWindow);
224 227
225 if (toolbarItem) 228 if (toolbarItem)
226 { 229 {
227 var property = getToolbarItemProperty(name); 230 var property = getToolbarItemProperty(name);
228 property.tabs.set(this._tab, value); 231 property.tabs.set(this._tab, value);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 }; 626 };
624 627
625 ext.onMessage = new BackgroundMessageEventTarget(); 628 ext.onMessage = new BackgroundMessageEventTarget();
626 629
627 // TODO: Implement context menu 630 // TODO: Implement context menu
628 ext.contextMenus = { 631 ext.contextMenus = {
629 create: function(title, contexts, onclick) {}, 632 create: function(title, contexts, onclick) {},
630 removeAll: function(callback) {} 633 removeAll: function(callback) {}
631 }; 634 };
632 })(); 635 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld