nsIUrlClassifierExceptionListService.idl (2761B)
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 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #include "nsISupports.idl" 6 #include "nsIUrlClassifierExceptionList.idl" 7 /** 8 * Observer for exception list updates. 9 */ 10 [scriptable, function, uuid(f7c918e5-94bf-4b6e-9758-ef7bdab6af7e)] 11 interface nsIUrlClassifierExceptionListObserver : nsISupports 12 { 13 /** 14 * Called by nsIUrlClassifierExceptionListService when the exception list 15 * for a designated feature changes and when the observer is first registered. 16 * 17 * @param aList 18 * An nsIUrlClassifierExceptionList object which can be queried for 19 * exceptions associated with the feature. 20 */ 21 void onExceptionListUpdate(in nsIUrlClassifierExceptionList aList); 22 }; 23 24 /** 25 * A service that monitors updates to the exception list of url-classifier 26 * feature from sources such as a local pref and remote settings updates. 27 */ 28 [scriptable, uuid(75c3d1a3-e977-4079-9e27-b3b56bdb76ea)] 29 interface nsIUrlClassifierExceptionListService : nsISupports 30 { 31 /** 32 * Register a new observer to exception list updates. When the observer is 33 * registered it is called immediately once. Afterwards it will be called 34 * whenever the specified pref changes or when remote settings for 35 * url-classifier features updates. 36 * 37 * @param aFeature 38 * The feature for which to observe the exception list. 39 * 40 * @param aPrefName 41 * (Optional) A pref name to monitor. The pref must be of string 42 * type and contain a comma-separated list of URL patterns. 43 * 44 * @param aObserver 45 * An nsIUrlClassifierExceptionListObserver object or function that 46 * will receive updates to the exception list as a comma-separated 47 * string. Will be called immediately with the current exception 48 * list value. 49 */ 50 void registerAndRunExceptionListObserver(in ACString aFeature, 51 in ACString aPrefName, 52 in nsIUrlClassifierExceptionListObserver aObserver); 53 54 /** 55 * Unregister an observer. 56 * 57 * @param aFeature 58 * The feature for which to stop observing. 59 * 60 * @param aObserver 61 * The nsIUrlClassifierExceptionListObserver object to unregister. 62 */ 63 void unregisterExceptionListObserver(in ACString aFeature, 64 in nsIUrlClassifierExceptionListObserver aObserver); 65 66 /** 67 * Clear all data in the service. 68 * This API is for testing only. 69 */ 70 void clear(); 71 72 /** 73 * Manually trigger the category prefs migration if it hasn't been run yet. 74 */ 75 void maybeMigrateCategoryPrefs(); 76 };