Backed out changeset 9b9a5c42fb46 (bug 859601) for bustage on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-04-10 15:44:33 -04:00
parent 433db949e9
commit a20b983060
9 changed files with 9 additions and 85 deletions

View File

@ -351,8 +351,6 @@
@BINPATH@/components/BrowserElementParent.js
@BINPATH@/components/ContactManager.js
@BINPATH@/components/ContactManager.manifest
@BINPATH@/components/NavigatorPropertyHelper.js
@BINPATH@/components/NavigatorPropertyHelper.manifest
@BINPATH@/components/PermissionSettings.js
@BINPATH@/components/PermissionSettings.manifest
@BINPATH@/components/PermissionPromptService.js

View File

@ -514,8 +514,6 @@
@BINPATH@/components/PermissionSettings.manifest
@BINPATH@/components/ContactManager.js
@BINPATH@/components/ContactManager.manifest
@BINPATH@/components/NavigatorPropteryHelper.js
@BINPATH@/components/NavigatorPropertyHelper.manifest
@BINPATH@/components/AlarmsManager.js
@BINPATH@/components/AlarmsManager.manifest
@BINPATH@/components/TCPSocket.js

View File

@ -21,8 +21,6 @@ EXTRA_COMPONENTS = \
SiteSpecificUserAgent.manifest \
ConsoleAPI.js \
ConsoleAPI.manifest \
NavigatorPropertyHelper.js \
NavigatorPropertyHelper.manifest \
$(NULL)
EXTRA_JS_MODULES = ConsoleAPIStorage.jsm \

View File

@ -1,66 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const DEBUG = false;
function debug(s) { dump("-*- NavigatorPropertyHelper: " + s + "\n"); }
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
function NavigatorPropertyHelper() { };
NavigatorPropertyHelper.prototype = {
classID : Components.ID("{f0d03420-a0ce-11e2-9e96-0800200c9a66}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
observe: function observe(subject, topic, data) {
if (DEBUG) debug("topic: " + topic + ", data: " + data);
let cm = Components.classes["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
switch (topic) {
case 'app-startup':
let enumerator = cm.enumerateCategory("JavaScript-navigator-property-maybe");
while (enumerator.hasMoreElements()) {
let entry = enumerator.getNext().QueryInterface(Ci.nsISupportsCString);
let keyVal = cm.getCategoryEntry("JavaScript-navigator-property-maybe", entry).split(',');
try {
if (Services.prefs.getBoolPref(entry)) {
if (DEBUG) debug("enable: " + keyVal[0]);
cm.addCategoryEntry("JavaScript-navigator-property", keyVal[0], keyVal[1], false, false);
}
} catch (ex) {
if (DEBUG) debug("no pref found: " + entry);
}
Services.prefs.addObserver(entry, this, true);
}
break;
case 'nsPref:changed':
let keyVal = cm.getCategoryEntry("JavaScript-navigator-property-maybe", data).split(',');
let key = keyVal[0];
let val = keyVal[1];
try {
if (Services.prefs.getBoolPref(data)) {
if (DEBUG) debug("enable: " + key);
cm.addCategoryEntry("JavaScript-navigator-property", key, val, false, false);
} else {
if (DEBUG) debug("disable: " + key);
cm.deleteCategoryEntry("JavaScript-navigator-property", key, false);
}
} catch (ex) {
if (DEBUG) debug("no pref found: " + data);
cm.deleteCategoryEntry("JavaScript-navigator-property", key, false);
}
break;
default:
if (DEBUG) debug("unknown topic: " + topic);
}
},
}
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NavigatorPropertyHelper])

View File

@ -1,3 +0,0 @@
component {f0d03420-a0ce-11e2-9e96-0800200c9a66} NavigatorPropertyHelper.js
contract @mozilla.org/navigatorPropertyHelper;1 {f0d03420-a0ce-11e2-9e96-0800200c9a66}
category app-startup NavigatorPropertyHelper service,@mozilla.org/navigatorPropertyHelper;1

View File

@ -700,6 +700,10 @@ ContactManager.prototype = {
},
init: function(aWindow) {
// Set navigator.mozContacts to null.
if (!Services.prefs.getBoolPref("dom.mozContacts.enabled"))
return null;
this.initHelper(aWindow, ["Contacts:Find:Return:OK", "Contacts:Find:Return:KO",
"Contacts:Clear:Return:OK", "Contacts:Clear:Return:KO",
"Contact:Save:Return:OK", "Contact:Save:Return:KO",

View File

@ -22,4 +22,4 @@ category JavaScript-global-constructor mozContact @mozilla.org/contact;1
component {1d70322b-f11b-4f19-9586-7bf291f212aa} ContactManager.js
contract @mozilla.org/contactManager;1 {1d70322b-f11b-4f19-9586-7bf291f212aa}
category JavaScript-navigator-property-maybe dom.mozContacts.enabled mozContacts,@mozilla.org/contactManager;1
category JavaScript-navigator-property mozContacts @mozilla.org/contactManager;1

View File

@ -228,13 +228,11 @@ function checkContacts(contact1, contact2) {
}
}
function tests() {
var req;
var index = 0;
var mozContacts = window.navigator.mozContacts;
ok(mozContacts, "mozContacts exists");
var steps = [
function () {
ok(true, "Deleting database");
@ -1247,12 +1245,11 @@ function permissionTest() {
}
}
permissionTest();
};
var gContactsEnabled = SpecialPowers.getBoolPref("dom.mozContacts.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
ok(true, "test passed");
</script>
</pre>
</body>

View File

@ -261,8 +261,6 @@
@BINPATH@/components/ConsoleAPI.js
@BINPATH@/components/ContactManager.js
@BINPATH@/components/ContactManager.manifest
@BINPATH@/components/NavigatorPropteryHelper.js
@BINPATH@/components/NavigatorPropertyHelper.manifest
@BINPATH@/components/SettingsManager.js
@BINPATH@/components/SettingsManager.manifest
@BINPATH@/components/SettingsService.js