зеркало из https://github.com/mozilla/gecko-dev.git
Bug 710895 - Part 2: Remove the old IE migrator
Original patch by Felipe Gomes<felipc@gmail.com> r=mak r=Mano
This commit is contained in:
Родитель
f4ba575127
Коммит
36453750dd
|
@ -36,12 +36,7 @@
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "@mozilla.org/profile/migrator;1?app=browser&type="
|
||||
|
||||
#ifdef XP_WIN
|
||||
#define NS_WINIEPROFILEMIGRATOR_CID \
|
||||
{ 0xbc15c73d, 0xc05b, 0x497b, { 0xa3, 0x73, 0x4b, 0xae, 0x6c, 0x17, 0x86, 0x31 } }
|
||||
|
||||
#define NS_WINIEHISTORYENUMERATOR_CID \
|
||||
{ 0x93480624, 0x806e, 0x4756, { 0xb7, 0xcb, 0x0f, 0xb7, 0xdd, 0x74, 0x6a, 0x8f } }
|
||||
|
||||
|
@ -49,11 +44,6 @@
|
|||
"@mozilla.org/profile/migrator/iehistoryenumerator;1"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#define NS_SAFARIPROFILEMIGRATOR_CID \
|
||||
{ 0x29e3b139, 0xad19, 0x44f3, { 0xb2, 0xc2, 0xe9, 0xf1, 0x3b, 0xa2, 0xbb, 0xc6 } }
|
||||
#endif
|
||||
|
||||
#define NS_SHELLSERVICE_CID \
|
||||
{ 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#endif
|
||||
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
#include "nsIEProfileMigrator.h"
|
||||
#include "nsIEHistoryEnumerator.h"
|
||||
#endif
|
||||
|
||||
|
@ -76,7 +75,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
|
|||
#endif
|
||||
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
|
||||
#endif
|
||||
|
||||
|
@ -93,7 +91,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_WINIEHISTORYENUMERATOR_CID);
|
||||
#elif defined(XP_MACOSX)
|
||||
NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
|
||||
|
@ -110,7 +107,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
|
|||
{ &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
|
||||
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
{ &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
|
||||
{ &kNS_WINIEHISTORYENUMERATOR_CID, false, NULL, nsIEHistoryEnumeratorConstructor },
|
||||
#elif defined(XP_MACOSX)
|
||||
{ &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
|
||||
|
@ -144,7 +140,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
|
|||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
|
||||
{ NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
|
||||
#elif defined(XP_MACOSX)
|
||||
{ NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
|
||||
|
|
|
@ -55,10 +55,7 @@ EXTRA_PP_COMPONENTS = \
|
|||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
|
||||
CPPSRCS += nsIEProfileMigrator.cpp \
|
||||
nsBrowserProfileMigratorUtils.cpp \
|
||||
nsIEHistoryEnumerator.cpp \
|
||||
$(NULL)
|
||||
CPPSRCS += nsIEHistoryEnumerator.cpp
|
||||
|
||||
EXTRA_PP_COMPONENTS += SafariProfileMigrator.js \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The Browser Profile Migrator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Ben Goodger.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ben Goodger <ben@bengoodger.com>
|
||||
* Asaf Romano <mozilla.mano@sent.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsBrowserProfileMigratorUtils.h"
|
||||
#include "nsINavBookmarksService.h"
|
||||
#include "nsBrowserCompsCID.h"
|
||||
#include "nsToolkitCompsCID.h"
|
||||
#include "nsIPlacesImportExportService.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIProperties.h"
|
||||
#include "nsIProfileMigrator.h"
|
||||
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsXPCOMCID.h"
|
||||
|
||||
void SetUnicharPref(const char* aPref, const nsAString& aValue,
|
||||
nsIPrefBranch* aPrefs)
|
||||
{
|
||||
nsCOMPtr<nsISupportsString> supportsString =
|
||||
do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID);
|
||||
if (supportsString) {
|
||||
supportsString->SetData(aValue);
|
||||
aPrefs->SetComplexValue(aPref, NS_GET_IID(nsISupportsString),
|
||||
supportsString);
|
||||
}
|
||||
}
|
||||
|
||||
void SetProxyPref(const nsAString& aHostPort, const char* aPref,
|
||||
const char* aPortPref, nsIPrefBranch* aPrefs)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsCAutoString host;
|
||||
PRInt32 portValue;
|
||||
|
||||
// try parsing it as a URI first
|
||||
if (NS_SUCCEEDED(NS_NewURI(getter_AddRefs(uri), aHostPort))
|
||||
&& NS_SUCCEEDED(uri->GetHost(host))
|
||||
&& !host.IsEmpty()
|
||||
&& NS_SUCCEEDED(uri->GetPort(&portValue))) {
|
||||
SetUnicharPref(aPref, NS_ConvertUTF8toUTF16(host), aPrefs);
|
||||
aPrefs->SetIntPref(aPortPref, portValue);
|
||||
}
|
||||
else {
|
||||
nsAutoString hostPort(aHostPort);
|
||||
PRInt32 portDelimOffset = hostPort.RFindChar(':');
|
||||
if (portDelimOffset > 0) {
|
||||
SetUnicharPref(aPref, Substring(hostPort, 0, portDelimOffset), aPrefs);
|
||||
nsAutoString port(Substring(hostPort, portDelimOffset + 1));
|
||||
nsresult stringErr;
|
||||
portValue = port.ToInteger(&stringErr);
|
||||
if (NS_SUCCEEDED(stringErr))
|
||||
aPrefs->SetIntPref(aPortPref, portValue);
|
||||
}
|
||||
else
|
||||
SetUnicharPref(aPref, hostPort, aPrefs);
|
||||
}
|
||||
}
|
||||
|
||||
void ParseOverrideServers(const nsAString& aServers, nsIPrefBranch* aBranch)
|
||||
{
|
||||
// Windows (and Opera) formats its proxy override list in the form:
|
||||
// server;server;server where server is a server name or ip address,
|
||||
// or "<local>". Mozilla's format is server,server,server, and <local>
|
||||
// must be translated to "localhost,127.0.0.1"
|
||||
nsAutoString override(aServers);
|
||||
PRInt32 left = 0, right = 0;
|
||||
for (;;) {
|
||||
right = override.FindChar(';', right);
|
||||
const nsAString& host = Substring(override, left,
|
||||
(right < 0 ? override.Length() : right) - left);
|
||||
if (host.EqualsLiteral("<local>"))
|
||||
override.Replace(left, 7, NS_LITERAL_STRING("localhost,127.0.0.1"));
|
||||
if (right < 0)
|
||||
break;
|
||||
left = right + 1;
|
||||
override.Replace(right, 1, NS_LITERAL_STRING(","));
|
||||
}
|
||||
SetUnicharPref("network.proxy.no_proxies_on", override, aBranch);
|
||||
}
|
||||
|
||||
void GetMigrateDataFromArray(MigrationData* aDataArray, PRInt32 aDataArrayLength,
|
||||
bool aReplace, nsIFile* aSourceProfile,
|
||||
PRUint16* aResult)
|
||||
{
|
||||
nsCOMPtr<nsIFile> sourceFile;
|
||||
bool exists;
|
||||
MigrationData* cursor;
|
||||
MigrationData* end = aDataArray + aDataArrayLength;
|
||||
for (cursor = aDataArray; cursor < end && cursor->fileName; ++cursor) {
|
||||
// When in replace mode, all items can be imported.
|
||||
// When in non-replace mode, only items that do not require file replacement
|
||||
// can be imported.
|
||||
if (aReplace || !cursor->replaceOnly) {
|
||||
aSourceProfile->Clone(getter_AddRefs(sourceFile));
|
||||
sourceFile->Append(nsDependentString(cursor->fileName));
|
||||
sourceFile->Exists(&exists);
|
||||
if (exists)
|
||||
*aResult |= cursor->sourceFlag;
|
||||
}
|
||||
NS_Free(cursor->fileName);
|
||||
cursor->fileName = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir)
|
||||
{
|
||||
if (aStartup) {
|
||||
aStartup->GetDirectory(getter_AddRefs(aProfileDir));
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIProperties> dirSvc
|
||||
(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
|
||||
if (dirSvc) {
|
||||
dirSvc->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile),
|
||||
(void**) getter_AddRefs(aProfileDir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The Browser Profile Migrator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Ben Goodger.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ben Goodger <ben@bengoodger.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef browserprofilemigratorutils___h___
|
||||
#define browserprofilemigratorutils___h___
|
||||
|
||||
#define MIGRATION_ITEMBEFOREMIGRATE "Migration:ItemBeforeMigrate"
|
||||
#define MIGRATION_ITEMMIGRATEERROR "Migration:ItemError"
|
||||
#define MIGRATION_ITEMAFTERMIGRATE "Migration:ItemAfterMigrate"
|
||||
#define MIGRATION_STARTED "Migration:Started"
|
||||
#define MIGRATION_ENDED "Migration:Ended"
|
||||
|
||||
#define NOTIFY_OBSERVERS(message, item) \
|
||||
mObserverService->NotifyObservers(nsnull, message, item)
|
||||
|
||||
#define COPY_DATA(func, replace, itemIndex) \
|
||||
if ((aItems & itemIndex || !aItems)) { \
|
||||
nsAutoString index; \
|
||||
index.AppendInt(itemIndex); \
|
||||
NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get()); \
|
||||
if (NS_FAILED(func(replace))) \
|
||||
NOTIFY_OBSERVERS(MIGRATION_ITEMMIGRATEERROR, index.get()); \
|
||||
NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get()); \
|
||||
}
|
||||
|
||||
#define NC_URI(property) \
|
||||
NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#"#property)
|
||||
|
||||
#define BATCH_ACTION_HISTORY 0
|
||||
#define BATCH_ACTION_HISTORY_REPLACE 1
|
||||
#define BATCH_ACTION_BOOKMARKS 2
|
||||
#define BATCH_ACTION_BOOKMARKS_REPLACE 3
|
||||
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsIProfileStartup;
|
||||
|
||||
|
||||
void SetUnicharPref(const char* aPref, const nsAString& aValue,
|
||||
nsIPrefBranch* aPrefs);
|
||||
|
||||
// Proxy utilities shared by the Opera and IE migrators
|
||||
void ParseOverrideServers(const nsAString& aServers, nsIPrefBranch* aBranch);
|
||||
void SetProxyPref(const nsAString& aHostPort, const char* aPref,
|
||||
const char* aPortPref, nsIPrefBranch* aPrefs);
|
||||
|
||||
struct MigrationData {
|
||||
PRUnichar* fileName;
|
||||
PRUint32 sourceFlag;
|
||||
bool replaceOnly;
|
||||
};
|
||||
|
||||
class nsILocalFile;
|
||||
void GetMigrateDataFromArray(MigrationData* aDataArray,
|
||||
PRInt32 aDataArrayLength,
|
||||
bool aReplace,
|
||||
nsIFile* aSourceProfile,
|
||||
PRUint16* aResult);
|
||||
|
||||
|
||||
// get the base directory of the *target* profile
|
||||
// this is already cloned, modify it to your heart's content
|
||||
void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
|
||||
|
||||
#endif
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,208 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/* Private header describing the class to migrate preferences from
|
||||
Windows Trident to Gecko. This is a virtual class. */
|
||||
|
||||
#ifndef ieprofilemigrator___h___
|
||||
#define ieprofilemigrator___h___
|
||||
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <ole2.h>
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsINavHistoryService.h"
|
||||
|
||||
class nsIFile;
|
||||
class nsICookieManager2;
|
||||
class nsIRDFResource;
|
||||
class nsINavBookmarksService;
|
||||
class nsIPrefBranch;
|
||||
|
||||
struct SignonData {
|
||||
PRUnichar* user;
|
||||
PRUnichar* pass;
|
||||
char* realm;
|
||||
};
|
||||
|
||||
// VC11 doesn't ship with pstore.h, so we go ahead and define the stuff that
|
||||
// we need from that file here.
|
||||
class IEnumPStoreItems : public IUnknown {
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE Next(DWORD celt, LPWSTR* rgelt,
|
||||
DWORD* pceltFetched) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Skip(DWORD celt) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Reset() = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumPStoreItems** ppenum) = 0;
|
||||
};
|
||||
|
||||
class IEnumPStoreTypes; // not used
|
||||
struct PST_PROVIDERINFO; // not used
|
||||
struct PST_TYPEINFO; // not used
|
||||
struct PST_PROMPTINFO; // not used
|
||||
struct PST_ACCESSRULESET; // not used
|
||||
typedef DWORD PST_KEY;
|
||||
typedef DWORD PST_ACCESSMODE;
|
||||
|
||||
class IPStore : public IUnknown {
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GetInfo(PST_PROVIDERINFO** ppProperties) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetProvParam(DWORD dwParam, DWORD* pcbData,
|
||||
BYTE** ppbData, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProvParam(DWORD dwParam, DWORD cbData,
|
||||
BYTE* pbData, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateType(PST_KEY Key, const GUID* pType,
|
||||
PST_TYPEINFO* pInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(PST_KEY Key, const GUID* pType,
|
||||
PST_TYPEINFO** ppInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteType(PST_KEY Key, const GUID* pType,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateSubtype(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_TYPEINFO* pInfo,
|
||||
PST_ACCESSRULESET* pRules, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetSubtypeInfo(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_TYPEINFO** ppInfo,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteSubtype(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadAccessRuleset(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_ACCESSRULESET** ppRules,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE WriteAccessRuleset(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_ACCESSRULESET* pRules,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumTypes(PST_KEY Key, DWORD dwFlags, IEnumPStoreTypes** ppenum) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumSubtypes(PST_KEY Key, const GUID* pType,
|
||||
DWORD dwFlags, IEnumPStoreTypes** ppenum) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD* pcbData, BYTE** ppbData,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE WriteItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD cbData, BYTE* pbData,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE OpenItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
PST_ACCESSMODE ModeFlags, PST_PROMPTINFO* pPromptInfo,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CloseItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumItems(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, DWORD dwFlags,
|
||||
IEnumPStoreItems** ppenum) = 0;
|
||||
};
|
||||
|
||||
|
||||
class nsIEProfileMigrator : public nsIBrowserProfileMigrator,
|
||||
public nsINavHistoryBatchCallback {
|
||||
public:
|
||||
NS_DECL_NSIBROWSERPROFILEMIGRATOR
|
||||
NS_DECL_NSINAVHISTORYBATCHCALLBACK
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsIEProfileMigrator();
|
||||
virtual ~nsIEProfileMigrator();
|
||||
|
||||
protected:
|
||||
nsresult CopyPreferences(bool aReplace);
|
||||
nsresult CopyStyleSheet(bool aReplace);
|
||||
nsresult CopyCookies(bool aReplace);
|
||||
nsresult CopyProxyPreferences(nsIPrefBranch* aPrefs);
|
||||
nsresult CopySecurityPrefs(nsIPrefBranch* aPrefs);
|
||||
/**
|
||||
* Migrate history to Places.
|
||||
* This will end up calling CopyHistoryBatched helper, that provides batch
|
||||
* support. Batching allows for better performances and integrity.
|
||||
*
|
||||
* @param aReplace
|
||||
* Indicates if we should replace current history or append to it.
|
||||
*/
|
||||
nsresult CopyHistory(bool aReplace);
|
||||
nsresult CopyHistoryBatched(bool aReplace);
|
||||
|
||||
bool KeyIsURI(const nsAString& aKey, char** aRealm);
|
||||
|
||||
nsresult CopyPasswords(bool aReplace);
|
||||
nsresult MigrateSiteAuthSignons(IPStore* aPStore);
|
||||
nsresult GetSignonsListFromPStore(IPStore* aPStore, nsTArray<SignonData>* aSignonsFound);
|
||||
nsresult ResolveAndMigrateSignons(IPStore* aPStore, nsTArray<SignonData>* aSignonsFound);
|
||||
void EnumerateUsernames(const nsAString& aKey, PRUnichar* aData, unsigned long aCount, nsTArray<SignonData>* aSignonsFound);
|
||||
void GetUserNameAndPass(unsigned char* data, unsigned long len, unsigned char** username, unsigned char** pass);
|
||||
|
||||
nsresult CopyFormData(bool aReplace);
|
||||
nsresult AddDataToFormHistory(const nsAString& aKey, PRUnichar* data, unsigned long len);
|
||||
/**
|
||||
* Migrate bookmarks to Places.
|
||||
* This will end up calling CopyFavoritesBatched helper, that provides batch
|
||||
* support. Batching allows for better performances and integrity.
|
||||
*
|
||||
* @param aReplace
|
||||
* Indicates if we should replace current bookmarks or append to them.
|
||||
* When appending we will usually default to bookmarks menu.
|
||||
*/
|
||||
nsresult CopyFavorites(bool aReplace);
|
||||
nsresult CopyFavoritesBatched(bool aReplace);
|
||||
void ResolveShortcut(const nsString &aFileName, char** aOutURL);
|
||||
nsresult ParseFavoritesFolder(nsIFile* aDirectory,
|
||||
PRInt64 aParentFolder,
|
||||
nsINavBookmarksService* aBookmarksService,
|
||||
const nsAString& aPersonalToolbarFolderName,
|
||||
bool aIsAtRootLevel);
|
||||
nsresult CopySmartKeywords(nsINavBookmarksService* aBMS,
|
||||
PRInt64 aParentFolder);
|
||||
|
||||
nsresult CopyCookiesFromBuffer(char *aBuffer, PRUint32 aBufferLength,
|
||||
nsICookieManager2 *aCookieManager);
|
||||
void DelimitField(char **aBuffer, const char *aBufferEnd, char **aField);
|
||||
time_t FileTimeToTimeT(const char *aLowDateIntString,
|
||||
const char *aHighDateIntString);
|
||||
void GetUserStyleSheetFile(nsIFile **aUserFile);
|
||||
bool TestForIE7();
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIObserverService> mObserverService;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Загрузка…
Ссылка в новой задаче