Bug 703377: remove now-unused pref override functionality, r=dolske

--HG--
extra : transplant_source : %C1%B65%07%B60XS%AB%DD%EF7Hx%A5%8Cz%11%04%97
This commit is contained in:
Gavin Sharp 2011-11-17 13:41:04 -08:00
parent 73d5366744
commit c1bc4b958c
5 changed files with 1 additions and 92 deletions

View File

@ -12,7 +12,6 @@
#include "nsArrayEnumerator.h"
#include "nsEnumeratorUtils.h"
#include "nsBrowserDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceDefs.h"
#include "nsCategoryManagerUtils.h"
@ -58,15 +57,6 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
}
}
}
else if (!strcmp(aKey, NS_APP_EXISTING_PREF_OVERRIDE)) {
rv = NS_GetSpecialDirectory(NS_APP_DEFAULTS_50_DIR,
getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, rv);
file->AppendNative(NS_LITERAL_CSTRING("existing-profile-defaults.js"));
file.swap(*aResult);
return NS_OK;
}
else {
return NS_ERROR_FAILURE;
}

View File

@ -1,24 +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/. */
#ifndef nsBrowserDirectoryServiceDefs_h___
#define nsBrowserDirectoryServiceDefs_h___
//=============================================================================
//
// Defines property names for directories available from the browser-specific
// nsBrowserDirectoryProvider.
//
// System and XPCOM properties are defined in nsDirectoryServiceDefs.h.
// General application properties are defined in nsAppDirectoryServiceDefs.h.
//
//=============================================================================
// ----------------------------------------------------------------------------
// Files and directories that exist on a per-browser basis.
// ----------------------------------------------------------------------------
#define NS_APP_EXISTING_PREF_OVERRIDE "ExistingPrefOverride"
#endif

View File

@ -10,17 +10,8 @@ function test_bookmarkhtml() {
do_check_true(bmarks.equals(tbmarks));
}
function test_prefoverride() {
let dir = gDirSvc.get("DefRt", Ci.nsIFile);
dir.append("existing-profile-defaults.js");
let tdir = gDirSvc.get("ExistingPrefOverride", Ci.nsIFile);
do_check_true(dir.equals(tdir));
}
function run_test() {
[test_bookmarkhtml,
test_prefoverride
[test_bookmarkhtml
].forEach(function(f) {
do_test_pending();
print("Running test: " + f.name);

View File

@ -172,40 +172,6 @@ function getPostUpdateOverridePage(defaultOverridePage) {
return update.getProperty("openURL") || defaultOverridePage;
}
// Copies a pref override file into the user's profile pref-override folder,
// and then tells the pref service to reload its default prefs.
function copyPrefOverride() {
try {
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
const NS_APP_EXISTING_PREF_OVERRIDE = "ExistingPrefOverride";
var prefOverride = fileLocator.get(NS_APP_EXISTING_PREF_OVERRIDE,
Components.interfaces.nsIFile);
if (!prefOverride.exists())
return; // nothing to do
const NS_APP_PREFS_OVERRIDE_DIR = "PrefDOverride";
var prefOverridesDir = fileLocator.get(NS_APP_PREFS_OVERRIDE_DIR,
Components.interfaces.nsIFile);
// Check for any existing pref overrides, and remove them if present
var existingPrefOverridesFile = prefOverridesDir.clone();
existingPrefOverridesFile.append(prefOverride.leafName);
if (existingPrefOverridesFile.exists())
existingPrefOverridesFile.remove(false);
prefOverride.copyTo(prefOverridesDir, null);
// Now that we've installed the new-profile pref override file,
// re-read the default prefs.
var prefSvcObs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIObserver);
prefSvcObs.observe(null, "reload-default-prefs", null);
} catch (ex) {
Components.utils.reportError(ex);
}
}
// Flag used to indicate that the arguments to openWindow can be passed directly.
const NO_EXTERNAL_URIS = 1;
@ -600,9 +566,6 @@ nsBrowserContentHandler.prototype = {
overridePage = Services.urlFormatter.formatURLPref("startup.homepage_welcome_url");
break;
case OVERRIDE_NEW_MSTONE:
// Existing profile, new milestone build.
copyPrefOverride();
// Check whether we have a session to restore. If we do, we assume
// that this is an "update" session.
var ss = Components.classes["@mozilla.org/browser/sessionstartup;1"]

View File

@ -99,17 +99,6 @@ $(STAGEDIST): $(DIST)/branding
$(DIST)/branding:
$(NSINSTALL) -D $@
libs::
@if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js > $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
fi
install::
@if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js > $(DESTDIR)$(mozappdir)/defaults/existing-profile-defaults.js; \
fi
PROFILE_FILES = \
localstore.rdf \
mimeTypes.rdf \