LEFT | RIGHT |
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 Cu.import("resource://gre/modules/Services.jsm"); | 5 Cu.import("resource://gre/modules/Services.jsm"); |
6 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); | 6 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
7 | 7 |
8 let {Prefs} = require("prefs"); | 8 let {Prefs} = require("prefs"); |
9 let {WindowObserver} = require("windowObserver"); | 9 let {WindowObserver} = require("windowObserver"); |
10 let {getSchemeCorrection, isKnownScheme, getDomainCorrection, getDomainReferral,
onWhitelistEntryAdded} = require("typoRules"); | 10 let {getSchemeCorrection, isKnownScheme, getDomainCorrection, getDomainReferral,
onWhitelistEntryAdded} = require("typoRules"); |
(...skipping 24 matching lines...) Expand all Loading... |
35 removeFromWindow: function(window) | 35 removeFromWindow: function(window) |
36 { | 36 { |
37 if (!appIntegration.isKnownWindow(window)) | 37 if (!appIntegration.isKnownWindow(window)) |
38 return; | 38 return; |
39 | 39 |
40 netError.removeFromWindow(window); | 40 netError.removeFromWindow(window); |
41 appIntegration.removeFromWindow(window); | 41 appIntegration.removeFromWindow(window); |
42 } | 42 } |
43 }); | 43 }); |
44 } | 44 } |
| 45 attachWindowObserver(); |
45 | 46 |
46 exports.detachWindowObserver = detachWindowObserver; | 47 exports.detachWindowObserver = detachWindowObserver; |
47 function detachWindowObserver() | 48 function detachWindowObserver() |
48 { | 49 { |
49 if (!typoWindowObserver) | 50 if (!typoWindowObserver) |
50 return; | 51 return; |
51 | 52 |
52 // Detach our handlers from all browser windows | 53 // Detach our handlers from all browser windows |
53 typoWindowObserver.shutdown(); | 54 typoWindowObserver.shutdown(); |
54 typoWindowObserver = null; | 55 typoWindowObserver = null; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 stringBundle = Services.strings.createBundle("chrome://" + require("info").a
ddonName + "/locale/typo.properties?" + Math.random()); | 210 stringBundle = Services.strings.createBundle("chrome://" + require("info").a
ddonName + "/locale/typo.properties?" + Math.random()); |
210 let result = [ | 211 let result = [ |
211 stringBundle.GetStringFromName("urlfixer.isItCorrect"), | 212 stringBundle.GetStringFromName("urlfixer.isItCorrect"), |
212 stringBundle.GetStringFromName("urlfixer.yes"), | 213 stringBundle.GetStringFromName("urlfixer.yes"), |
213 stringBundle.GetStringFromName("urlfixer.no") | 214 stringBundle.GetStringFromName("urlfixer.no") |
214 ]; | 215 ]; |
215 | 216 |
216 getInfobarTexts = function() result; | 217 getInfobarTexts = function() result; |
217 return getInfobarTexts(); | 218 return getInfobarTexts(); |
218 } | 219 } |
LEFT | RIGHT |