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

Side by Side Diff: lib/prefs.js

Issue 5430129207541760: Issue 1358 - Publish build tools under the MPL 2.0 license (Closed)
Patch Set: Created Sept. 11, 2014, 3:41 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/keySelector.js ('k') | lib/windowObserver.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * This file is part of the Adblock Plus build tools, 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17 4
18 Cu.import("resource://gre/modules/Services.jsm"); 5 Cu.import("resource://gre/modules/Services.jsm");
19 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); 6 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
20 7
21 let {addonRoot, addonName} = require("info"); 8 let {addonRoot, addonName} = require("info");
22 let branchName = "extensions." + addonName + "."; 9 let branchName = "extensions." + addonName + ".";
23 let branch = Services.prefs.getBranch(branchName); 10 let branch = Services.prefs.getBranch(branchName);
24 let ignorePrefChanges = false; 11 let ignorePrefChanges = false;
25 12
26 function init() 13 function init()
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 { 181 {
195 let str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsSt ring); 182 let str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsSt ring);
196 str.data = newValue; 183 str.data = newValue;
197 branch.setComplexValue(pref, Ci.nsISupportsString, str); 184 branch.setComplexValue(pref, Ci.nsISupportsString, str);
198 } 185 }
199 186
200 function getJSONPref(branch, pref) JSON.parse(getCharPref(branch, pref)) 187 function getJSONPref(branch, pref) JSON.parse(getCharPref(branch, pref))
201 function setJSONPref(branch, pref, newValue) setCharPref(branch, pref, JSON.stri ngify(newValue)) 188 function setJSONPref(branch, pref, newValue) setCharPref(branch, pref, JSON.stri ngify(newValue))
202 189
203 init(); 190 init();
OLDNEW
« no previous file with comments | « lib/keySelector.js ('k') | lib/windowObserver.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld