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

Delta Between Two Patch Sets: lib/appIntegration.js

Issue 8433028: added hook function to appIntegration to handle function-overwrites from other extensions (Closed)
Left Patch Set: applied code review changes Created Sept. 28, 2012, 8:01 a.m.
Right Patch Set: added missing statement Created Sept. 28, 2012, 9:52 a.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/content/tests/tests/suffixTreeManipulation.js ('k') | lib/hooks.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 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 let {hook} = require("hooks"); 5 let {hook} = require("hooks");
6 let functionHooks = new WeakMap(); 6 let functionHooks = new WeakMap();
7 7
8 exports.removeFromWindow = function(window) 8 exports.removeFromWindow = function(window)
9 { 9 {
10 if (functionHooks.has(window)) 10 if (functionHooks.has(window))
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 }; 117 };
118 118
119 let basicRemove = exports.removeFromWindow; 119 let basicRemove = exports.removeFromWindow;
120 exports.removeFromWindow = function(window) 120 exports.removeFromWindow = function(window)
121 { 121 {
122 basicRemove(window); 122 basicRemove(window);
123 123
124 if (eventListeners.has(window)) 124 if (eventListeners.has(window))
125 { 125 {
126 let eventListener = eventListeners.get(window); 126 let eventListener = eventListeners.get(window);
127 eventListener.element.removeEventListener("command", eventListener.liste ner, true); 127 eventListener.element.removeEventListener("command", eventListener.liste ner, true);
Wladimir Palant 2012/09/28 09:35:19 Taking over comment from previous review: eventLi
128 eventListeners.delete(window);
128 } 129 }
129 }; 130 };
130 131
131 exports.openInfobar = function(window, id, message, buttons, persistence) 132 exports.openInfobar = function(window, id, message, buttons, persistence)
132 { 133 {
133 let browser = exports.getBrowser(window); 134 let browser = exports.getBrowser(window);
134 let infobar = browser.getNotificationBox(); 135 let infobar = browser.getNotificationBox();
135 let notif = infobar.getNotificationWithValue(id); 136 let notif = infobar.getNotificationWithValue(id);
136 137
137 if (notif) 138 if (notif)
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 }; 286 };
286 287
287 break; 288 break;
288 } 289 }
289 default: 290 default:
290 { 291 {
291 exports.isKnownWindow = function(window) false; 292 exports.isKnownWindow = function(window) false;
292 break; 293 break;
293 } 294 }
294 } 295 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld