--HG--
rename : browser/components/sessionstore/test/browser/Makefile.in => browser/components/sessionstore/test/Makefile.in
rename : browser/devtools/webconsole/test/browser/Makefile.in => browser/devtools/webconsole/test/Makefile.in
rename : browser/devtools/webconsole/test/browser/browser_gcli_integrate.js => browser/devtools/webconsole/test/browser_gcli_integrate.js
rename : browser/devtools/webconsole/test/browser/browser_gcli_web.js => browser/devtools/webconsole/test/browser_gcli_web.js
rename : browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js => browser/devtools/webconsole/test/browser_webconsole_bug_595934_message_categories.js
rename : browser/devtools/webconsole/test/browser/browser_webconsole_bug_642108_pruneTest.js => browser/devtools/webconsole/test/browser_webconsole_bug_642108_pruneTest.js
rename : browser/devtools/webconsole/test/browser/browser_webconsole_bug_653531_highlighter_console_helper.js => browser/devtools/webconsole/test/browser_webconsole_bug_653531_highlighter_console_helper.js
rename : browser/devtools/webconsole/test/browser/test-console-extras.html => browser/devtools/webconsole/test/test-console-extras.html
This commit is contained in:
David Anderson 2011-12-16 15:06:51 -08:00
Родитель 766a056c9e 1172cf871a
Коммит fef38f2704
1600 изменённых файлов: 169367 добавлений и 33441 удалений

Просмотреть файл

@ -44,7 +44,6 @@
#include "nsMai.h"
#include "prlink.h"
#include "prenv.h"
#include "mozilla/Preferences.h"
#include "nsIGConfService.h"
#include "nsIServiceManager.h"
#include "nsAutoPtr.h"
@ -64,10 +63,6 @@ static const char sATKLibName[] = "libatk-1.0.so.0";
static const char sATKHyperlinkImplGetTypeSymbol[] =
"atk_hyperlink_impl_get_type";
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
static const char sUseSystemPrefsKey[] =
"config.use_system_prefs";
static const char sAccessibilityKey [] =
"config.use_system_prefs.accessibility";
static const char sGconfAccessibilityKey[] =
"/desktop/gnome/interface/accessibility";
@ -630,18 +625,13 @@ nsApplicationAccessibleWrap::Init()
isGnomeATEnabled = !!atoi(envValue);
} else {
//check gconf-2 setting
if (Preferences::GetBool(sUseSystemPrefsKey, false)) {
nsresult rv;
nsCOMPtr<nsIGConfService> gconf =
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && gconf) {
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
&isGnomeATEnabled);
}
} else {
isGnomeATEnabled =
Preferences::GetBool(sAccessibilityKey, false);
}
nsresult rv;
nsCOMPtr<nsIGConfService> gconf =
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && gconf) {
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
&isGnomeATEnabled);
}
}
if (isGnomeATEnabled) {

Просмотреть файл

@ -214,6 +214,10 @@ protected:
static bool gIsFormFillEnabled;
private:
nsAccessNode();
nsAccessNode(const nsAccessNode&);
nsAccessNode& operator =(const nsAccessNode&);
static nsApplicationAccessible *gApplicationAccessible;
};

Просмотреть файл

@ -1199,13 +1199,11 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (!newAcc) {
// Create generic accessibles for SVG and MathML nodes.
if (content->GetNameSpaceID() == kNameSpaceID_SVG &&
content->Tag() == nsGkAtoms::svg) {
if (content->IsSVG(nsGkAtoms::svg)) {
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
nsIAccessibleRole::ROLE_DIAGRAM);
}
else if (content->GetNameSpaceID() == kNameSpaceID_MathML &&
content->Tag() == nsGkAtoms::math) {
else if (content->IsMathML(nsGkAtoms::math)) {
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
nsIAccessibleRole::ROLE_EQUATION);
}

Просмотреть файл

@ -75,7 +75,6 @@ EXPORTS = \
nsApplicationAccessibleWrap.h \
mozDocAccessible.h \
mozAccessible.h \
mozAccessibleWrapper.h \
mozAccessibleProtocol.h \
mozActionElements.h \
mozTextAccessible.h \

Просмотреть файл

@ -56,13 +56,6 @@
using namespace mozilla::a11y;
// These constants are only defined in OS X SDK 10.4, so we define them in order
// to be able to use for earlier OS versions.
const NSString *kInstanceDescriptionAttribute = @"AXDescription"; // NSAccessibilityDescriptionAttribute
const NSString *kTopLevelUIElementAttribute = @"AXTopLevelUIElement"; // NSAccessibilityTopLevelUIElementAttribute
const NSString *kTextLinkSubrole = @"AXTextLink"; // NSAccessibilitySecureTextFieldSubrole
const NSString *kURLAttribute = @"AXURL";
// converts a screen-global point in the cocoa coordinate system (with origo in the bottom-left corner
// of the screen), into a top-left screen point, that gecko can use.
static inline void
@ -200,8 +193,8 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
NSAccessibilityFocusedAttribute,
NSAccessibilityHelpAttribute,
NSAccessibilityTitleUIElementAttribute,
kTopLevelUIElementAttribute,
kInstanceDescriptionAttribute,
NSAccessibilityTopLevelUIElementAttribute,
NSAccessibilityDescriptionAttribute,
nil];
}
@ -238,7 +231,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
return [self value];
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
return NSAccessibilityRoleDescription([self role], nil);
if ([attribute isEqualToString: (NSString*) kInstanceDescriptionAttribute])
if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
return [self customDescription];
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
return [NSNumber numberWithBool:[self isFocused]];
@ -246,7 +239,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
return [self size];
if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
return [self window];
if ([attribute isEqualToString: (NSString*) kTopLevelUIElementAttribute])
if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute])
return [self window];
if ([attribute isEqualToString:NSAccessibilityTitleAttribute])
return [self title];
@ -361,9 +354,8 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
nsCOMPtr<nsIAccessible> accessibleParent(mGeckoAccessible->GetUnignoredParent());
if (accessibleParent) {
id nativeParent = GetNativeFromGeckoAccessible(accessibleParent);
if (nativeParent) {
if (nativeParent)
return mParent = GetClosestInterestingAccessible(nativeParent);
}
}
// GetUnignoredParent() returns null when there is no unignored accessible all the way up to
@ -375,8 +367,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
id nativeParent = GetNativeFromGeckoAccessible(static_cast<nsIAccessible*>(root));
NSAssert1 (nativeParent, @"!!! we can't find a parent for %@", self);
mParent = GetClosestInterestingAccessible(nativeParent);
return mParent;
return mParent = GetClosestInterestingAccessible(nativeParent);
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}

Просмотреть файл

@ -1,91 +0,0 @@
/* -*- Mode: Objective-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
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Håkan Waara <hwaara@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 "nsAccessibleWrap.h"
#include "nsObjCExceptions.h"
#import "mozAccessible.h"
/* Wrapper class.
This is needed because C++-only headers such as nsAccessibleWrap.h must not depend
on Objective-C and Cocoa. Classes in accessible/src/base depend on them, and other modules in turn
depend on them, so in the end all of Mozilla would end up having to link against Cocoa and be renamed .mm :-)
In order to have a mozAccessible object wrapped, the user passes itself (nsAccessible*) and the subclass of
mozAccessible that should be instantiated.
In the header file, the AccessibleWrapper is used as the member, and is forward-declared (because this header
cannot be #included directly.
*/
struct AccessibleWrapper {
mozAccessible *object;
AccessibleWrapper (nsAccessibleWrap *parent, Class classType) {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
object = (mozAccessible*)[[classType alloc] initWithAccessible:parent];
NS_OBJC_END_TRY_ABORT_BLOCK;
}
~AccessibleWrapper () {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
// if some third-party still holds on to the object, it's important that it is marked
// as expired, so it can't do any harm (e.g., walk into an expired hierarchy of nodes).
[object expire];
[object release];
NS_OBJC_END_TRY_ABORT_BLOCK;
}
mozAccessible* getNativeObject () {
return object;
}
bool isIgnored () {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
return (bool)[object accessibilityIsIgnored];
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
}
};

Просмотреть файл

@ -43,9 +43,6 @@
using namespace mozilla::a11y;
extern const NSString *kInstanceDescriptionAttribute; // NSAccessibilityDescriptionAttribute
extern const NSString *kTopLevelUIElementAttribute; // NSAccessibilityTopLevelUIElementAttribute
enum CheckboxValue {
// these constants correspond to the values in the OS
kUnchecked = 0,
@ -67,12 +64,12 @@ enum CheckboxValue {
NSAccessibilitySizeAttribute, // required
NSAccessibilityWindowAttribute, // required
NSAccessibilityPositionAttribute, // required
kTopLevelUIElementAttribute, // required
NSAccessibilityTopLevelUIElementAttribute, // required
NSAccessibilityHelpAttribute,
NSAccessibilityEnabledAttribute, // required
NSAccessibilityFocusedAttribute, // required
NSAccessibilityTitleAttribute, // required
kInstanceDescriptionAttribute,
NSAccessibilityDescriptionAttribute,
nil];
}
return attributes;
@ -194,13 +191,13 @@ enum CheckboxValue {
NSAccessibilityRoleAttribute, // required
NSAccessibilitySizeAttribute, // required
NSAccessibilityWindowAttribute, // required
kTopLevelUIElementAttribute, // required
NSAccessibilityTopLevelUIElementAttribute, // required
NSAccessibilityHelpAttribute,
NSAccessibilityEnabledAttribute, // required
NSAccessibilityFocusedAttribute, // required
NSAccessibilityTitleAttribute, // required for popupmenus, and for menubuttons with a title
NSAccessibilityChildrenAttribute, // required
kInstanceDescriptionAttribute, // required if it has no title attr
NSAccessibilityDescriptionAttribute, // required if it has no title attr
nil];
}
return attributes;

Просмотреть файл

@ -81,12 +81,11 @@ static id <mozAccessible, mozView> getNativeViewFromRootAccessible (nsAccessible
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if ([attribute isEqualToString:NSAccessibilityMainAttribute]) {
if ([attribute isEqualToString:NSAccessibilityMainAttribute])
return [NSNumber numberWithBool:[[self window] isMainWindow]];
}
if ([attribute isEqualToString:NSAccessibilityMinimizedAttribute]) {
if ([attribute isEqualToString:NSAccessibilityMinimizedAttribute])
return [NSNumber numberWithBool:[[self window] isMiniaturized]];
}
return [super accessibilityAttributeValue:attribute];
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;

Просмотреть файл

@ -5,9 +5,6 @@
using namespace mozilla::a11y;
extern const NSString *kInstanceDescriptionAttribute; // NSAccessibilityDescriptionAttribute
extern const NSString *kTopLevelUIElementAttribute; // NSAccessibilityTopLevelUIElementAttribute
@interface mozTextAccessible (Private)
- (NSString*)subrole;
- (NSString*)selectedText;
@ -55,8 +52,8 @@ extern const NSString *kTopLevelUIElementAttribute; // NSAccessibilityTopLevel
NSAccessibilityWindowAttribute, // required
NSAccessibilityFocusedAttribute, // required
NSAccessibilityEnabledAttribute, // required
kTopLevelUIElementAttribute, // required (on OS X 10.4+)
kInstanceDescriptionAttribute, // required (on OS X 10.4+)
NSAccessibilityTopLevelUIElementAttribute, // required
NSAccessibilityDescriptionAttribute, // required
/* text-specific attributes */
NSAccessibilitySelectedTextAttribute, // required
NSAccessibilitySelectedTextRangeAttribute, // required
@ -256,8 +253,8 @@ extern const NSString *kTopLevelUIElementAttribute; // NSAccessibilityTopLevel
NSAccessibilityChildrenAttribute, // required
NSAccessibilityHelpAttribute,
// NSAccessibilityExpandedAttribute, // required
kTopLevelUIElementAttribute, // required (on OS X 10.4+)
kInstanceDescriptionAttribute, // required (on OS X 10.4+)
NSAccessibilityTopLevelUIElementAttribute, // required
NSAccessibilityDescriptionAttribute, // required
/* text-specific attributes */
NSAccessibilitySelectedTextAttribute, // required
NSAccessibilitySelectedTextRangeAttribute, // required

Просмотреть файл

@ -55,7 +55,9 @@
#include "nsTArray.h"
#include "nsAutoPtr.h"
struct AccessibleWrapper;
#if defined(__OBJC__)
@class mozAccessible;
#endif
class nsAccessibleWrap : public nsAccessible
{
@ -63,9 +65,6 @@ class nsAccessibleWrap : public nsAccessible
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessibleWrap();
// creates the native accessible connected to this one.
virtual bool Init ();
// get the native obj-c object (mozAccessible)
NS_IMETHOD GetNativeInterface (void **aOutAccessible);
@ -91,17 +90,43 @@ class nsAccessibleWrap : public nsAccessible
void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
virtual already_AddRefed<nsIAccessible> GetUnignoredParent();
protected:
protected:
virtual nsresult FirePlatformEvent(AccEvent* aEvent);
virtual nsresult FirePlatformEvent(AccEvent* aEvent);
/**
* Return true if the parent doesn't have children to expose to AT.
*/
bool AncestorIsFlat();
// Wrapper around our native object.
AccessibleWrapper *mNativeWrapper;
/**
* Get the native object. Create it if needed.
*/
#if defined(__OBJC__)
mozAccessible* GetNativeObject();
#else
id GetNativeObject();
#endif
private:
/**
* Our native object. Private because its creation is done lazily.
* Don't access it directly. Ever. Unless you are GetNativeObject() or Shutdown()
*/
#if defined(__OBJC__)
// if we are in Objective-C, we use the actual Obj-C class.
mozAccessible* mNativeObject;
#else
id mNativeObject;
#endif
/**
* We have created our native. This does not mean there is one.
* This can never go back to false.
* We need it because checking whether we need a native object cost time.
*/
bool mNativeInited;
};
// Define unsupported wrap classes here

Просмотреть файл

@ -41,49 +41,44 @@
#import "nsRoleMap.h"
#import "mozAccessibleWrapper.h"
#import "mozAccessible.h"
#import "mozActionElements.h"
#import "mozTextAccessible.h"
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mNativeWrapper(nsnull)
nsAccessible(aContent, aShell), mNativeObject(nil),
mNativeInited(false)
{
}
nsAccessibleWrap::~nsAccessibleWrap()
{
if (mNativeWrapper) {
delete mNativeWrapper;
mNativeWrapper = nsnull;
}
}
bool
nsAccessibleWrap::Init ()
mozAccessible*
nsAccessibleWrap::GetNativeObject()
{
if (!nsAccessible::Init())
return false;
if (!mNativeWrapper && !AncestorIsFlat()) {
// Create our native object using the class type specified in GetNativeType().
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
if (!mNativeWrapper)
return false;
}
return true;
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if (!mNativeInited && !mNativeObject && !IsDefunct() && !AncestorIsFlat())
mNativeObject = [[GetNativeType() alloc] initWithAccessible:this];
mNativeInited = true;
return mNativeObject;
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
NS_IMETHODIMP
nsAccessibleWrap::GetNativeInterface (void **aOutInterface)
{
if (mNativeWrapper) {
*aOutInterface = (void**)mNativeWrapper->getNativeObject();
return NS_OK;
}
return NS_ERROR_FAILURE;
NS_ENSURE_ARG_POINTER(aOutInterface);
*aOutInterface = static_cast<void*>(GetNativeObject());
return *aOutInterface ? NS_OK : NS_ERROR_FAILURE;
}
// overridden in subclasses to create the right kind of object. by default we create a generic
@ -141,11 +136,16 @@ nsAccessibleWrap::GetNativeType ()
void
nsAccessibleWrap::Shutdown ()
{
if (mNativeWrapper) {
delete mNativeWrapper;
mNativeWrapper = nsnull;
// this ensure we will not try to re-create the native object.
mNativeInited = true;
// we really intend to access the member directly.
if (mNativeObject) {
[mNativeObject expire];
[mNativeObject release];
mNativeObject = nil;
}
nsAccessible::Shutdown();
}
@ -201,10 +201,8 @@ nsAccessibleWrap::InvalidateChildren()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
if (mNativeWrapper) {
mozAccessible *object = mNativeWrapper->getNativeObject();
[object invalidateChildren];
}
[GetNativeObject() invalidateChildren];
nsAccessible::InvalidateChildren();
NS_OBJC_END_TRY_ABORT_BLOCK;
@ -215,7 +213,12 @@ nsAccessibleWrap::InvalidateChildren()
bool
nsAccessibleWrap::IsIgnored()
{
return (mNativeWrapper == nsnull) || mNativeWrapper->isIgnored();
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
mozAccessible* nativeObject = GetNativeObject();
return (!nativeObject) || [nativeObject accessibilityIsIgnored];
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
}
void

Просмотреть файл

@ -48,12 +48,6 @@ public:
nsIWeakReference *aShell);
virtual ~nsDocAccessibleWrap();
// nsIAccessNode
/**
* Creates the native accessible connected to this one.
*/
virtual bool Init();
};
#endif

Просмотреть файл

@ -37,7 +37,7 @@
#include "nsDocAccessibleWrap.h"
#import "mozAccessibleWrapper.h"
#import "mozAccessible.h"
nsDocAccessibleWrap::
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
@ -50,20 +50,3 @@ nsDocAccessibleWrap::~nsDocAccessibleWrap()
{
}
bool
nsDocAccessibleWrap::Init ()
{
if (!nsDocAccessible::Init())
return false;
NS_ASSERTION(!mNativeWrapper, "nsDocAccessibleWrap::Init() called more than once!");
if (!mNativeWrapper) {
// Create our native object using the class type specified in GetNativeType().
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
if (!mNativeWrapper)
return false;
}
return true;
}

Просмотреть файл

@ -45,9 +45,6 @@
#include "nsIWidget.h"
#include "nsIViewManager.h"
#import "mozAccessibleWrapper.h"
nsRootAccessibleWrap::
nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :

Просмотреть файл

@ -42,7 +42,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = chrome locales app
DIRS = chrome components locales app
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/testing/testsuite-targets.mk

Просмотреть файл

@ -65,11 +65,8 @@ pref("browser.cache.memory.capacity", 1024); // kilobytes
pref("image.cache.size", 1048576); // bytes
/* offline cache prefs */
pref("browser.offline-apps.notify", true);
pref("browser.cache.offline.enable", true);
pref("browser.cache.offline.capacity", 5120); // kilobytes
pref("offline-apps.quota.max", 2048); // kilobytes
pref("offline-apps.quota.warn", 1024); // kilobytes
pref("browser.offline-apps.notify", false);
pref("browser.cache.offline.enable", false);
/* protocol warning prefs */
pref("network.protocol-handler.warn-external.tel", false);

Просмотреть файл

@ -68,14 +68,23 @@ function startupHttpd(baseDir, port) {
Services.scriptloader.loadSubScript(httpdURL, httpd);
let server = new httpd.nsHttpServer();
server.registerDirectory('/', new LocalFile(baseDir));
server.registerContentType('appcache', 'text/cache-manifest');
server.start(port);
}
// XXX until we have a security model, just let the pre-installed
// app used indexedDB.
function allowIndexedDB(url) {
let uri = Services.io.newURI(url, null, null);
Services.perms.add(uri, 'indexedDB', Ci.nsIPermissionManager.ALLOW_ACTION);
// FIXME Bug 707625
// until we have a proper security model, add some rights to
// the pre-installed web applications
function addPermissions(urls) {
let permissions = ['indexedDB', 'webapps-manage', 'offline-app'];
urls.forEach(function(url) {
let uri = Services.io.newURI(url, null, null);
let allow = Ci.nsIPermissionManager.ALLOW_ACTION;
permissions.forEach(function(permission) {
Services.perms.add(uri, permission, allow);
});
});
}
@ -114,6 +123,7 @@ var shell = {
window.controllers.appendController(this);
window.addEventListener('keypress', this);
window.addEventListener('MozApplicationManifest', this);
this.home.addEventListener('load', this, true);
try {
@ -133,7 +143,7 @@ var shell = {
let baseHost = 'http://localhost';
homeURL = homeURL.replace(baseDir, baseHost + ':' + SERVER_PORT);
}
allowIndexedDB(homeURL);
addPermissions([homeURL]);
} catch (e) {
let msg = 'Fatal error during startup: [' + e + '[' + homeURL + ']';
return alert(msg);
@ -147,6 +157,7 @@ var shell = {
stop: function shell_stop() {
window.controllers.removeController(this);
window.removeEventListener('keypress', this);
window.removeEventListener('MozApplicationManifest', this);
},
supportsCommand: function shell_supportsCommand(cmd) {
@ -169,7 +180,7 @@ var shell = {
doCommand: function shell_doCommand(cmd) {
switch (cmd) {
case 'cmd_close':
this.sendEvent(this.home.contentWindow, 'appclose');
this.home.contentWindow.postMessage('appclose', '*');
break;
}
},
@ -195,6 +206,40 @@ var shell = {
this.home.removeEventListener('load', this, true);
this.sendEvent(window, 'ContentStart');
break;
case 'MozApplicationManifest':
try {
if (!Services.prefs.getBoolPref('browser.cache.offline.enable'))
return;
let contentWindow = evt.originalTarget.defaultView;
let documentElement = contentWindow.document.documentElement;
if (!documentElement)
return;
let manifest = documentElement.getAttribute("manifest");
if (!manifest)
return;
let documentURI = contentWindow.document.documentURIObject;
if (!Services.perms.testPermission(documentURI, 'offline-app')) {
if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
// FIXME Bug 710729 - Add a UI for offline cache notifications
return;
}
return;
}
Services.perms.add(documentURI, 'offline-app',
Ci.nsIPermissionManager.ALLOW_ACTION);
let manifestURI = Services.io.newURI(manifest, null, documentURI);
let updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
.getService(Ci.nsIOfflineCacheUpdateService);
updateService.scheduleUpdate(manifestURI, documentURI, window);
} catch (e) {
dump('Error while creating offline cache: ' + e + '\n');
}
break;
}
},
sendEvent: function shell_sendEvent(content, type, details) {

Просмотреть файл

Просмотреть файл

@ -1,4 +1,3 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
@ -12,11 +11,11 @@
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
# The Original Code is Mozilla.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Mozilla Foundation <http://www.mozilla.org/>.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
@ -35,16 +34,18 @@
#
# ***** END LICENSE BLOCK *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = libreg
MODULE = B2GComponents
XPIDL_MODULE = B2GComponents
DIRS = include src
EXTRA_PP_COMPONENTS = \
B2GComponents.manifest \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -42,6 +42,7 @@ security/manager/locales/Makefile
b2g/app/Makefile
$MOZ_BRANDING_DIRECTORY/Makefile
b2g/chrome/Makefile
b2g/components/Makefile
b2g/installer/Makefile
b2g/locales/Makefile
b2g/Makefile"

Просмотреть файл

@ -47,6 +47,7 @@ PARALLEL_DIRS = \
components \
fuel \
locales \
modules \
themes \
$(NULL)

Просмотреть файл

@ -180,20 +180,20 @@ libs:: $(srcdir)/blocklist.xml
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
APP_NAME = $(MOZ_APP_DISPLAYNAME)
MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
ifdef MOZ_DEBUG
APP_NAME := $(APP_NAME)Debug
MAC_APP_NAME := $(MAC_APP_NAME)Debug
endif
LOWER_APP_NAME = $(shell echo $(APP_NAME) | tr '[A-Z]' '[a-z]')
LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')
AB_CD = $(MOZ_UI_LOCALE)
AB := $(firstword $(subst -, ,$(AB_CD)))
clean clobber repackage::
$(RM) -r $(DIST)/$(APP_NAME).app
$(RM) -r $(DIST)/$(MOZ_MACBUNDLE_NAME)
ifdef LIBXUL_SDK
APPFILES = Resources
@ -202,26 +202,24 @@ APPFILES = MacOS
endif
libs repackage:: $(PROGRAM)
$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/MacOS
rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
sed -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
$(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist
sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj/InfoPlist.strings
rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/mangle $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/shlibsign
ifdef LIBXUL_SDK
cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox
cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/firefox
else
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
endif
-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
# remove CVS dirs from packaged app
find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/firefox.icns
cp -RL $(DIST)/branding/document.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/document.icns
printf APPLMOZB > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo
else
ifdef LIBXUL_SDK
@ -234,7 +232,7 @@ ifdef LIBXUL_SDK
ifndef SKIP_COPY_XULRUNNER
libs::
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Frameworks
else
$(NSINSTALL) -D $(DIST)/bin/xulrunner
(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)

Просмотреть файл

@ -225,4 +225,4 @@
</gfxItems>
</blocklist>
</blocklist>

Просмотреть файл

@ -145,15 +145,15 @@
<key>CFBundleExecutable</key>
<string>firefox</string>
<key>CFBundleGetInfoString</key>
<string>%APP_NAME% %APP_VERSION%</string>
<string>%MAC_APP_NAME% %APP_VERSION%</string>
<key>CFBundleIconFile</key>
<string>firefox</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.%LOWER_APP_NAME%</string>
<string>org.mozilla.%LOWER_MAC_APP_NAME%</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>%APP_NAME%</string>
<string>%MAC_APP_NAME%</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

Просмотреть файл

@ -1 +1 @@
CFBundleName = "%APP_NAME%";
CFBundleName = "%MAC_APP_NAME%";

Просмотреть файл

@ -66,7 +66,7 @@ pref("extensions.getAddons.cache.enabled", true);
pref("extensions.getAddons.maxResults", 15);
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%");
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=firefox");
pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%");
// Blocklist preferences
@ -945,6 +945,7 @@ pref("services.sync.prefs.sync.browser.safebrowsing.enabled", true);
pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true);
pref("services.sync.prefs.sync.browser.search.selectedEngine", true);
pref("services.sync.prefs.sync.browser.search.update", true);
pref("services.sync.prefs.sync.browser.sessionstore.restore_on_demand", true);
pref("services.sync.prefs.sync.browser.startup.homepage", true);
pref("services.sync.prefs.sync.browser.startup.page", true);
pref("services.sync.prefs.sync.browser.tabs.autoHide", true);
@ -1012,6 +1013,12 @@ pref("devtools.inspector.htmlHeight", 112);
// Enable the style inspector
pref("devtools.styleinspector.enabled", true);
// Enable the Tilt inspector
pref("devtools.tilt.enabled", true);
// Enable the Tilt inspector even if WebGL capabilities are not detected
pref("devtools.tilt.force-enabled", false);
// Enable the rules view
pref("devtools.ruleview.enabled", true);

Просмотреть файл

@ -53,11 +53,6 @@ ifdef ENABLE_TESTS
DIRS += content/test
endif
EXTRA_JS_MODULES = \
content/openLocationLastURL.jsm \
content/NetworkPrioritizer.jsm \
$(NULL)
include $(topsrcdir)/config/rules.mk
PRE_RELEASE_SUFFIX := ""

Просмотреть файл

@ -148,6 +148,8 @@
oncommand="InspectorUI.toggleInspection();"/>
<command id="Inspector:Sidebar"
oncommand="InspectorUI.toggleSidebar();"/>
<command id="Inspector:Tilt"
oncommand="Tilt.initialize();"/>
</commandset>
<broadcasterset id="mainBroadcasterSet">

Просмотреть файл

@ -55,6 +55,7 @@
# David Dahl <ddahl@mozilla.com>
# Patrick Walton <pcwalton@mozilla.com>
# Mihai Sucan <mihai.sucan@gmail.com>
# Victor Porof <vporof@mozilla.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
@ -179,6 +180,12 @@ XPCOMUtils.defineLazyGetter(this, "InspectorUI", function() {
return new tmp.InspectorUI(window);
});
XPCOMUtils.defineLazyGetter(this, "Tilt", function() {
let tmp = {};
Cu.import("resource:///modules/devtools/Tilt.jsm", tmp);
return new tmp.Tilt(window);
});
let gInitialPages = [
"about:blank",
"about:privatebrowsing",
@ -200,7 +207,7 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
if (WINTASKBAR_CONTRACTID in Cc &&
Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
let temp = {};
Cu.import("resource://gre/modules/WindowsPreviewPerTab.jsm", temp);
Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", temp);
let AeroPeek = temp.AeroPeek;
return {
onOpenWindow: function () {

Просмотреть файл

@ -37,6 +37,7 @@
# Patrick Walton <pcwalton@mozilla.com>
# David Dahl <ddahl@mozilla.com>
# Frank Yan <fyan@mozilla.com>
# Victor Porof <vporof@mozilla.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
@ -1007,6 +1008,11 @@
flex="1" orient="horizontal"
clicktoscroll="true"/>
<hbox id="inspector-tools">
<toolbarbutton id="inspector-3D-button"
hidden="true"
label="&inspect3DButton.label;"
accesskey="&inspect3DButton.accesskey;"
command="Inspector:Tilt"/>
<toolbarbutton id="inspector-style-button"
label="&inspectStyleButton.label;"
accesskey="&inspectStyleButton.accesskey;"

Просмотреть файл

@ -226,7 +226,7 @@ function onIndexedDBClear()
initIndexedDBRow();
}
function onIndexedDBUsageCallback(uri, usage)
function onIndexedDBUsageCallback(uri, usage, fileUsage)
{
if (!uri.equals(gPermURI)) {
throw new Error("Callback received for bad URI: " + uri);

Просмотреть файл

@ -91,7 +91,6 @@ endif
_BROWSER_FILES = \
browser_typeAheadFind.js \
browser_keywordSearch.js \
browser_NetworkPrioritizer.js \
browser_allTabsPanel.js \
browser_alltabslistener.js \
browser_bug304198.js \
@ -170,6 +169,7 @@ _BROWSER_FILES = \
browser_bug647886.js \
browser_bug655584.js \
browser_bug664672.js \
browser_bug710878.js \
browser_canonizeURL.js \
browser_findbarClose.js \
browser_keywordBookmarklets.js \

Просмотреть файл

@ -1,14 +1,16 @@
var tab1, tab2;
function focus_in_navbar() {
function focus_in_navbar()
{
var parent = document.activeElement.parentNode;
while (parent && parent.id != "nav-bar")
parent = parent.parentNode;
return (parent != null);
return parent != null;
}
function test() {
function test()
{
waitForExplicitFinish();
tab1 = gBrowser.addTab("about:blank", {skipAnimation: true});
@ -20,7 +22,8 @@ function test() {
function step2()
{
isnot(document.activeElement, tab1, "mouse on tab not activeElement");
is(gBrowser.selectedTab, tab1, "1st click on tab1 selects tab");
isnot(document.activeElement, tab1, "1st click on tab1 does not activate tab");
EventUtils.synthesizeMouseAtCenter(tab1, {});
setTimeout(step3, 0);
@ -28,18 +31,21 @@ function step2()
function step3()
{
isnot(document.activeElement, tab1, "mouse on tab again activeElement");
is(gBrowser.selectedTab, tab1, "2nd click on selected tab1 keeps tab selected");
isnot(document.activeElement, tab1, "2nd click on selected tab1 does not activate tab");
if (gNavToolbox.getAttribute("tabsontop") == "true") {
ok(true, "[tabsontop=true] focusing URLBar then sending 1 Shift+Tab.");
gURLBar.focus();
EventUtils.synthesizeKey("VK_TAB", {shiftKey: true});
} else {
ok(true, "[tabsontop=false] focusing SearchBar then sending Tab(s) until out of nav-bar.");
document.getElementById("searchbar").focus();
while (focus_in_navbar())
EventUtils.synthesizeKey("VK_TAB", { });
}
is(document.activeElement, tab1, "tab key to tab activeElement");
is(gBrowser.selectedTab, tab1, "tab key to selected tab1 keeps tab selected");
is(document.activeElement, tab1, "tab key to selected tab1 activates tab");
EventUtils.synthesizeMouseAtCenter(tab1, {});
setTimeout(step4, 0);
@ -47,7 +53,8 @@ function step3()
function step4()
{
is(document.activeElement, tab1, "mouse on tab while focused still activeElement");
is(gBrowser.selectedTab, tab1, "3rd click on activated tab1 keeps tab selected");
is(document.activeElement, tab1, "3rd click on activated tab1 keeps tab activated");
EventUtils.synthesizeMouseAtCenter(tab2, {});
setTimeout(step5, 0);
@ -56,9 +63,11 @@ function step4()
function step5()
{
// The tabbox selects a tab within a setTimeout in a bubbling mousedown event
// listener, and focuses the current tab if another tab previously had focus
is(document.activeElement, tab2, "mouse on another tab while focused still activeElement");
// listener, and focuses the current tab if another tab previously had focus.
is(gBrowser.selectedTab, tab2, "click on tab2 while tab1 is activated selects tab");
is(document.activeElement, tab2, "click on tab2 while tab1 is activated activates tab");
ok(true, "focusing content then sending middle-button mousedown to tab2.");
content.focus();
EventUtils.synthesizeMouseAtCenter(tab2, {button: 1, type: "mousedown"});
setTimeout(step6, 0);
@ -66,10 +75,11 @@ function step5()
function step6()
{
isnot(document.activeElement, tab2, "tab not focused via middle click");
is(gBrowser.selectedTab, tab2, "middle-button mousedown on selected tab2 keeps tab selected");
isnot(document.activeElement, tab2, "middle-button mousedown on selected tab2 does not activate tab");
gBrowser.removeTab(tab1);
gBrowser.removeTab(tab2);
gBrowser.removeTab(tab1);
finish();
}

Просмотреть файл

@ -0,0 +1,29 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test()
{
waitForExplicitFinish();
let doc;
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onload() {
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
doc = content.document;
waitForFocus(performTest, content);
}, true);
content.location = "data:text/html,<a href='%23xxx'><span>word1 <span> word2 </span></span><span> word3</span></a>";
function performTest()
{
let link = doc.querySelector("a");;
let text = gatherTextUnder(link);
is(text, "word1 word2 word3", "Text under link is correctly computed.");
doc = null;
gBrowser.removeCurrentTab();
finish();
}
}

Просмотреть файл

@ -368,13 +368,13 @@ function gatherTextUnder ( root )
node = node.firstChild;
depth++;
} else {
// No children, try next sibling.
// No children, try next sibling (or parent next sibling).
while ( depth > 0 && !node.nextSibling ) {
node = node.parentNode;
depth--;
}
if ( node.nextSibling ) {
node = node.nextSibling;
} else {
// Last resort is our next oldest uncle/aunt.
node = node.parentNode.nextSibling;
depth--;
}
}
}

Просмотреть файл

@ -69,22 +69,16 @@ PARALLEL_DIRS = \
search \
sessionstore \
shell \
sidebar/src \
sidebar \
tabview \
migration \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
PARALLEL_DIRS += wintaskbar
endif
ifdef MOZ_SAFE_BROWSING
PARALLEL_DIRS += safebrowsing
endif
ifdef ENABLE_TESTS
DIRS += test/browser
endif
TEST_DIRS += test
DIRS += build

Просмотреть файл

@ -52,20 +52,15 @@ ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
endif
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib)
# migration requires mozreg
LOCAL_INCLUDES += -I$(srcdir)/../migration/src
SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
# This has to come after the above chunk, because mozreg_s has dependencies on
# stuff in MOZ_COMPONENT_LIBS.
EXTRA_DSO_LDOPTS += \
$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../migration/src
SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
# GTK2: Need to link with glib for GNOME shell service
ifneq (,$(filter cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))

Просмотреть файл

@ -48,9 +48,6 @@
{ 0x29e3b139, 0xad19, 0x44f3, { 0xb2, 0xc2, 0xe9, 0xf1, 0x3b, 0xa2, 0xbb, 0xc6 } }
#endif
#define NS_OPERAPROFILEMIGRATOR_CID \
{ 0xf34ff792, 0x722e, 0x4490, { 0xb1, 0x95, 0x47, 0xd2, 0x42, 0xed, 0xca, 0x1c } }
#define NS_SHELLSERVICE_CID \
{ 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }

Просмотреть файл

@ -50,9 +50,6 @@
#endif
#include "nsProfileMigrator.h"
#if !defined(XP_OS2)
#include "nsOperaProfileMigrator.h"
#endif
#if defined(XP_WIN) && !defined(__MINGW32__)
#include "nsIEProfileMigrator.h"
#elif defined(XP_MACOSX)
@ -80,9 +77,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
#if !defined(XP_OS2)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
#if defined(XP_WIN) && !defined(__MINGW32__)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator)
@ -109,9 +103,6 @@ NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SAFARIPROFILEMIGRATOR_CID);
#endif
#if !defined(XP_OS2)
NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
#endif
NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
@ -129,9 +120,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
#elif defined(XP_MACOSX)
{ &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
{ &kNS_SAFARIPROFILEMIGRATOR_CID, false, NULL, nsSafariProfileMigratorConstructor },
#endif
#if !defined(XP_OS2)
{ &kNS_OPERAPROFILEMIGRATOR_CID, false, NULL, nsOperaProfileMigratorConstructor },
#endif
{ &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
{ NULL }
@ -166,9 +154,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
#elif defined(XP_MACOSX)
{ NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "safari", &kNS_SAFARIPROFILEMIGRATOR_CID },
#endif
#if !defined(XP_OS2)
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "opera", &kNS_OPERAPROFILEMIGRATOR_CID },
#endif
{ NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
{ NULL }

Просмотреть файл

@ -765,7 +765,7 @@ FeedWriter.prototype = {
#expand if (fp.file.leafName != "__MOZ_APP_NAME__.exe") {
#else
#ifdef XP_MACOSX
#expand if (fp.file.leafName != "__MOZ_APP_DISPLAYNAME__.app") {
#expand if (fp.file.leafName != "__MOZ_MACBUNDLE_NAME__") {
#else
#expand if (fp.file.leafName != "__MOZ_APP_NAME__-bin") {
#endif

Просмотреть файл

@ -50,7 +50,7 @@ endif
DEFINES += \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
$(NULL)
EXTRA_COMPONENTS = \

Просмотреть файл

@ -333,9 +333,6 @@ var MigrationWizard = {
case "ie":
source = "sourceNameIE";
break;
case "opera":
source = "sourceNameOpera";
break;
case "safari":
source = "sourceNameSafari";
break;

Просмотреть файл

@ -70,14 +70,10 @@
browser/components/migration/src/nsProfileMigrator.cpp -->
#ifdef XP_MACOSX
<radio id="safari" label="&importFromSafari.label;" accesskey="&importFromSafari.accesskey;"/>
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
#elifdef XP_UNIX
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
#elifdef XP_WIN
#ifndef NO_IE_MIGRATOR
<radio id="ie" label="&importFromIE.label;" accesskey="&importFromIE.accesskey;"/>
#endif
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
#endif
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
<radio id="fromfile" label="&importFromHTMLFile.label;" accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>

Просмотреть файл

@ -53,10 +53,6 @@ CPPSRCS = nsProfileMigrator.cpp \
nsBrowserProfileMigratorUtils.cpp \
$(NULL)
ifneq ($(OS_ARCH),OS2)
CPPSRCS += nsOperaProfileMigrator.cpp
endif
ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
CPPSRCS += nsIEProfileMigrator.cpp \
$(NULL)

Просмотреть файл

@ -42,8 +42,6 @@
#include "nsToolkitCompsCID.h"
#include "nsIPlacesImportExportService.h"
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsILineInputStream.h"
#include "nsIProperties.h"
#include "nsIProfileMigrator.h"
@ -165,57 +163,6 @@ GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir)
}
}
nsresult
AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
nsIFile* aTargetBookmarksFile,
const char* aToolbarFolderName)
{
nsCOMPtr<nsIInputStream> fileInputStream;
nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream),
aSourceBookmarksFile);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIOutputStream> outputStream;
rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream),
aTargetBookmarksFile);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILineInputStream> lineInputStream =
do_QueryInterface(fileInputStream, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString sourceBuffer;
nsCAutoString targetBuffer;
bool moreData = false;
PRUint32 bytesWritten = 0;
do {
lineInputStream->ReadLine(sourceBuffer, &moreData);
if (!moreData)
break;
PRInt32 nameOffset = sourceBuffer.Find(aToolbarFolderName);
if (nameOffset >= 0) {
// Found the personal toolbar name on a line, check to make sure it's
// actually a folder.
NS_NAMED_LITERAL_CSTRING(folderPrefix, "<DT><H3 ");
PRInt32 folderPrefixOffset = sourceBuffer.Find(folderPrefix);
if (folderPrefixOffset >= 0)
sourceBuffer.Insert(NS_LITERAL_CSTRING("PERSONAL_TOOLBAR_FOLDER=\"true\" "),
folderPrefixOffset + folderPrefix.Length());
}
targetBuffer.Assign(sourceBuffer);
targetBuffer.Append("\r\n");
outputStream->Write(targetBuffer.get(), targetBuffer.Length(),
&bytesWritten);
}
while (1);
outputStream->Close();
return NS_OK;
}
nsresult
ImportBookmarksHTML(nsIFile* aBookmarksFile,
bool aImportIntoRoot,

Просмотреть файл

@ -99,15 +99,6 @@ void GetMigrateDataFromArray(MigrationData* aDataArray,
// this is already cloned, modify it to your heart's content
void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
// The Netscape Bookmarks Format (bookmarks.html) is fairly standard but
// each browser vendor seems to have their own way of identifying the
// Personal Toolbar Folder. This function scans for the vendor-specific
// name in the source Bookmarks file and then writes out a normalized
// variant into the target folder.
nsresult AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
nsIFile* aTargetBookmarksFile,
const char* aToolbarFolderName);
// In-place import from aBookmarksFile into a folder in the user's bookmarks.
// If the importIntoRoot parameter has a value of true, the bookmarks will be
// imported into the bookmarks root folder. Otherwise, they'll be imported into

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,224 +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 operaprofilemigrator___h___
#define operaprofilemigrator___h___
#include "nsCOMPtr.h"
#include "nsIBinaryInputStream.h"
#include "nsIBrowserProfileMigrator.h"
#include "nsIObserverService.h"
#include "nsStringAPI.h"
#include "nsTArray.h"
#include "nsIMutableArray.h"
#include "nsINavHistoryService.h"
#include "nsIStringBundle.h"
class nsICookieManager2;
class nsILineInputStream;
class nsILocalFile;
class nsINIParser;
class nsIPermissionManager;
class nsIPrefBranch;
class nsINavBookmarksService;
class nsIRDFResource;
class nsOperaProfileMigrator : public nsIBrowserProfileMigrator,
public nsINavHistoryBatchCallback
{
public:
NS_DECL_NSIBROWSERPROFILEMIGRATOR
NS_DECL_NSINAVHISTORYBATCHCALLBACK
NS_DECL_ISUPPORTS
nsOperaProfileMigrator();
virtual ~nsOperaProfileMigrator();
public:
typedef enum { STRING, INT, BOOL, COLOR } PrefType;
typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
struct PrefTransform {
const char* sectionName;
const char* keyName;
PrefType type;
const char* targetPrefName;
prefConverter prefSetterFunc;
bool prefHasValue;
union {
PRInt32 intValue;
bool boolValue;
char* stringValue;
};
};
static nsresult SetFile(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetCookieBehavior(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetBool(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetWString(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetInt(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetString(void* aTransform, nsIPrefBranch* aBranch);
protected:
nsresult CopyPreferences(bool aReplace);
nsresult ParseColor(nsINIParser &aParser, const char* aSectionName,
char** aResult);
nsresult CopyUserContentSheet(nsINIParser &aParser);
nsresult CopyProxySettings(nsINIParser &aParser, nsIPrefBranch* aBranch);
nsresult GetInteger(nsINIParser &aParser, const char* aSectionName,
const char* aKeyName, PRInt32* aResult);
nsresult CopyCookies(bool aReplace);
/**
* 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);
/**
* Migrate bookmarks to Places.
* This will end up calling CopyBookmarksBatched 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 CopyBookmarks(bool aReplace);
nsresult CopyBookmarksBatched(bool aReplace);
void ClearToolbarFolder(nsINavBookmarksService * aBookmarksService,
PRInt64 aToolbarFolder);
nsresult ParseBookmarksFolder(nsILineInputStream* aStream,
PRInt64 aFolder,
PRInt64 aToolbar,
nsINavBookmarksService* aBMS);
#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
nsresult CopySmartKeywords(nsINavBookmarksService* aBMS,
nsIStringBundle* aBundle,
PRInt64 aParentFolder);
#endif // defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
void GetOperaProfile(const PRUnichar* aProfile, nsILocalFile** aFile);
private:
nsCOMPtr<nsILocalFile> mOperaProfile;
nsCOMPtr<nsIMutableArray> mProfiles;
nsCOMPtr<nsIObserverService> mObserverService;
};
class nsOperaCookieMigrator
{
public:
nsOperaCookieMigrator(nsIInputStream* aSourceStream);
virtual ~nsOperaCookieMigrator();
nsresult Migrate();
typedef enum { BEGIN_DOMAIN_SEGMENT = 0x01,
DOMAIN_COMPONENT = 0x1E,
END_DOMAIN_SEGMENT = 0x84 | 0x80, // 0x04 | (1 << 8)
BEGIN_PATH_SEGMENT = 0x02,
PATH_COMPONENT = 0x1D,
END_PATH_SEGMENT = 0x05 | 0x80, // 0x05 | (1 << 8)
FILTERING_INFO = 0x1F,
PATH_HANDLING_INFO = 0x21,
THIRD_PARTY_HANDLING_INFO = 0x25,
BEGIN_COOKIE_SEGMENT = 0x03,
COOKIE_ID = 0x10,
COOKIE_DATA = 0x11,
COOKIE_EXPIRY = 0x12,
COOKIE_LASTUSED = 0x13,
COOKIE_COMMENT = 0x14,
COOKIE_COMMENT_URL = 0x15,
COOKIE_V1_DOMAIN = 0x16,
COOKIE_V1_PATH = 0x17,
COOKIE_V1_PORT_LIMITATIONS = 0x18,
COOKIE_SECURE = 0x19 | 0x80,
COOKIE_VERSION = 0x1A,
COOKIE_OTHERFLAG_1 = 0x1B | 0x80,
COOKIE_OTHERFLAG_2 = 0x1C | 0x80,
COOKIE_OTHERFLAG_3 = 0x20 | 0x80,
COOKIE_OTHERFLAG_4 = 0x22 | 0x80,
COOKIE_OTHERFLAG_5 = 0x23 | 0x80,
COOKIE_OTHERFLAG_6 = 0x24 | 0x80
} TAG;
protected:
nsOperaCookieMigrator() { }
nsresult ReadHeader();
void SynthesizePath(char** aResult);
void SynthesizeDomain(char** aResult);
nsresult AddCookieOverride(nsIPermissionManager* aManager);
nsresult AddCookie(nsICookieManager2* aManager);
private:
nsCOMPtr<nsIBinaryInputStream> mStream;
nsTArray<char*> mDomainStack;
nsTArray<char*> mPathStack;
struct Cookie {
nsCString id;
nsCString data;
PRInt32 expiryTime;
bool isSecure;
};
PRUint32 mAppVersion;
PRUint32 mFileVersion;
PRUint16 mTagTypeLength;
PRUint16 mPayloadTypeLength;
bool mCookieOpen;
Cookie mCurrCookie;
PRUint8 mCurrHandlingInfo;
};
#endif

Просмотреть файл

@ -56,7 +56,6 @@
#include "nsDirectoryServiceDefs.h"
#include "nsServiceManagerUtils.h"
#include "NSReg.h"
#include "nsStringAPI.h"
#include "nsUnicharUtils.h"
#ifdef XP_WIN
@ -69,18 +68,6 @@
#include "nsAutoPtr.h"
#ifndef MAXPATHLEN
#ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#elif defined(_MAX_PATH)
#define MAXPATHLEN _MAX_PATH
#elif defined(CCHMAXPATH)
#define MAXPATHLEN CCHMAXPATH
#else
#define MAXPATHLEN 1024
#endif
#endif
///////////////////////////////////////////////////////////////////////////////
// nsIProfileMigrator
@ -143,15 +130,6 @@ nsProfileMigrator::Migrate(nsIProfileStartup* aStartup)
getter_AddRefs(migrateWizard));
}
NS_IMETHODIMP
nsProfileMigrator::Import()
{
if (ImportRegistryProfiles(NS_LITERAL_CSTRING("Firefox")))
return NS_OK;
return NS_ERROR_FAILURE;
}
///////////////////////////////////////////////////////////////////////////////
// nsProfileMigrator
@ -161,7 +139,6 @@ NS_IMPL_ISUPPORTS1(nsProfileMigrator, nsIProfileMigrator)
#define INTERNAL_NAME_IEXPLORE "iexplore"
#define INTERNAL_NAME_MOZILLA_SUITE "apprunner"
#define INTERNAL_NAME_OPERA "opera"
#define INTERNAL_NAME_CHROME "chrome"
#endif
@ -242,10 +219,6 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
aKey = "ie";
return NS_OK;
}
else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_OPERA)) {
aKey = "opera";
return NS_OK;
}
else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_CHROME)) {
aKey = "chrome";
return NS_OK;
@ -265,117 +238,9 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
#if defined(XP_MACOSX)
CHECK_MIGRATOR("safari");
#endif
CHECK_MIGRATOR("opera");
CHECK_MIGRATOR("chrome");
#undef CHECK_MIGRATOR
#endif
return NS_ERROR_FAILURE;
}
bool
nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName)
{
nsresult rv;
nsCOMPtr<nsIToolkitProfileService> profileSvc
(do_GetService(NS_PROFILESERVICE_CONTRACTID));
NS_ENSURE_TRUE(profileSvc, false);
nsCOMPtr<nsIProperties> dirService
(do_GetService("@mozilla.org/file/directory_service;1"));
NS_ENSURE_TRUE(dirService, false);
nsCOMPtr<nsILocalFile> regFile;
#ifdef XP_WIN
rv = dirService->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat"));
#elif defined(XP_MACOSX)
rv = dirService->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("Application Registry"));
#elif defined(XP_OS2)
rv = dirService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat"));
#else
rv = dirService->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, false);
nsCAutoString dotAppName;
ToLowerCase(aAppName, dotAppName);
dotAppName.Insert('.', 0);
regFile->AppendNative(dotAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("appreg"));
#endif
nsCAutoString path;
rv = regFile->GetNativePath(path);
NS_ENSURE_SUCCESS(rv, false);
if (NR_StartupRegistry())
return false;
bool migrated = false;
HREG reg = nsnull;
RKEY profiles = 0;
REGENUM enumstate = 0;
char profileName[MAXREGNAMELEN];
if (NR_RegOpen(path.get(), &reg))
goto cleanup;
if (NR_RegGetKey(reg, ROOTKEY_COMMON, "Profiles", &profiles))
goto cleanup;
while (!NR_RegEnumSubkeys(reg, profiles, &enumstate,
profileName, MAXREGNAMELEN, REGENUM_CHILDREN)) {
#ifdef DEBUG_bsmedberg
printf("Found profile %s.\n", profileName);
#endif
RKEY profile = 0;
if (NR_RegGetKey(reg, profiles, profileName, &profile)) {
NS_ERROR("Could not get the key that was enumerated.");
continue;
}
char profilePath[MAXPATHLEN];
if (NR_RegGetEntryString(reg, profile, "directory",
profilePath, MAXPATHLEN))
continue;
nsCOMPtr<nsILocalFile> profileFile
(do_CreateInstance("@mozilla.org/file/local;1"));
if (!profileFile)
continue;
#if defined (XP_MACOSX)
rv = profileFile->SetPersistentDescriptor(nsDependentCString(profilePath));
#else
NS_ConvertUTF8toUTF16 widePath(profilePath);
rv = profileFile->InitWithPath(widePath);
#endif
if (NS_FAILED(rv)) continue;
nsCOMPtr<nsIToolkitProfile> tprofile;
profileSvc->CreateProfile(profileFile, nsnull,
nsDependentCString(profileName),
getter_AddRefs(tprofile));
migrated = true;
}
cleanup:
if (reg)
NR_RegClose(reg);
NR_ShutdownRegistry();
return migrated;
}

Просмотреть файл

@ -58,12 +58,6 @@ protected:
nsresult GetDefaultBrowserMigratorKey(nsACString& key,
nsCOMPtr<nsIBrowserProfileMigrator>& bpm);
/**
* Import profiles from ~/.firefox/
* @return true if any profiles imported.
*/
bool ImportRegistryProfiles(const nsACString& aAppName);
};
#endif

Просмотреть файл

@ -46,6 +46,9 @@
#include <CoreFoundation/CoreFoundation.h>
class nsIPrefBranch;
class nsINavBookmarksService;
class nsIRDFResource;
class nsIRDFDataSource;
class nsSafariProfileMigrator : public nsIBrowserProfileMigrator,

Просмотреть файл

@ -221,8 +221,9 @@ var gEditItemOverlay = {
this._allTags = this._getCommonTags();
this._initTextField("tagsField", this._allTags.join(", "), false);
this._element("itemsCountText").value =
PlacesUIUtils.getFormattedString("detailsPane.multipleItems",
[this._itemIds.length]);
PlacesUIUtils.getPluralString("detailsPane.itemsCountLabel",
this._itemIds.length,
[this._itemIds.length]);
}
// tags selector

Просмотреть файл

@ -713,8 +713,8 @@ var PlacesOrganizer = {
var itemsCountLabel = document.getElementById("itemsCountText");
selectItemDesc.hidden = false;
itemsCountLabel.value =
PlacesUIUtils.getFormattedString("detailsPane.multipleItems",
[aNodeList.length]);
PlacesUIUtils.getPluralString("detailsPane.itemsCountLabel",
aNodeList.length, [aNodeList.length]);
infoBox.hidden = true;
return;
}
@ -743,13 +743,9 @@ var PlacesOrganizer = {
}
else {
selectItemDesc.hidden = false;
if (rowCount == 1)
itemsCountLabel.value = PlacesUIUtils.getString("detailsPane.oneItem");
else {
itemsCountLabel.value =
PlacesUIUtils.getFormattedString("detailsPane.multipleItems",
[rowCount]);
}
itemsCountLabel.value =
PlacesUIUtils.getPluralString("detailsPane.itemsCountLabel",
rowCount, [rowCount]);
}
}
},

Просмотреть файл

@ -1339,7 +1339,7 @@ PlacesTreeView.prototype = {
// if they go through the "result" API.
if (PlacesUtils.nodeIsSeparator(node))
return "";
return PlacesUIUtils.getBestTitle(node);
return PlacesUIUtils.getBestTitle(node, true);
case this.COLUMN_TYPE_TAGS:
return node.tags;
case this.COLUMN_TYPE_URI:

Просмотреть файл

@ -50,6 +50,9 @@ var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() {
Cu.import("resource://gre/modules/PlacesUtils.jsm");
return PlacesUtils;
@ -79,6 +82,31 @@ var PlacesUIUtils = {
return bundle.formatStringFromName(key, params, params.length);
},
/**
* Get a localized plural string for the specified key name and numeric value
* substituting parameters.
*
* @param aKey
* String, key for looking up the localized string in the bundle
* @param aNumber
* Number based on which the final localized form is looked up
* @param aParams
* Array whose items will substitute #1, #2,... #n parameters
* in the string.
*
* @see https://developer.mozilla.org/en/Localization_and_Plurals
* @return The localized plural string.
*/
getPluralString: function PUIU_getPluralString(aKey, aNumber, aParams) {
let str = PluralForm.get(aNumber, bundle.GetStringFromName(aKey));
// Replace #1 with aParams[0], #2 with aParams[1], and so on.
return str.replace(/\#(\d+)/g, function (matchedId, matchedNumber) {
let param = aParams[parseInt(matchedNumber, 10) - 1];
return param !== undefined ? param : matchedId;
});
},
getString: function PUIU_getString(key) {
return bundle.GetStringFromName(key);
},
@ -719,7 +747,7 @@ var PlacesUIUtils = {
return aUrlString.substr(0, aUrlString.indexOf(":"));
},
getBestTitle: function PUIU_getBestTitle(aNode) {
getBestTitle: function PUIU_getBestTitle(aNode, aDoNotCutTitle) {
var title;
if (!aNode.title && PlacesUtils.uriTypes.indexOf(aNode.type) != -1) {
// if node title is empty, try to set the label using host and filename
@ -729,9 +757,13 @@ var PlacesUIUtils = {
var host = uri.host;
var fileName = uri.QueryInterface(Ci.nsIURL).fileName;
// if fileName is empty, use path to distinguish labels
title = host + (fileName ?
(host ? "/" + this.ellipsis + "/" : "") + fileName :
uri.path);
if (aDoNotCutTitle) {
title = host + uri.path;
} else {
title = host + (fileName ?
(host ? "/" + this.ellipsis + "/" : "") + fileName :
uri.path);
}
}
catch (e) {
// Use (no title) for non-standard URIs (data:, javascript:, ...)

Просмотреть файл

@ -336,7 +336,7 @@ var bookmarksObserver = {
let cellText = tree.view.getCellText(aElementOrTreeIndex,
tree.columns.getColumnAt(0));
if (!aNewValue)
return cellText == PlacesUIUtils.getBestTitle(tree.view.nodeForTreeIndex(aElementOrTreeIndex));
return cellText == PlacesUIUtils.getBestTitle(tree.view.nodeForTreeIndex(aElementOrTreeIndex), true);
return cellText == aNewValue;
}
else {

Просмотреть файл

@ -51,7 +51,7 @@ include $(topsrcdir)/config/rules.mk
DEFINES += \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
$(NULL)
ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))

Просмотреть файл

@ -596,18 +596,6 @@ var gAdvancedPane = {
},
#endif
/**
* The Extensions checkbox and button are disabled only if the enable Addon
* update preference is locked.
*/
updateAddonUpdateUI: function ()
{
var enabledPref = document.getElementById("extensions.update.enabled");
var enableAddonUpdate = document.getElementById("enableAddonUpdate");
enableAddonUpdate.disabled = enabledPref.locked;
},
// ENCRYPTION TAB
/*

Просмотреть файл

@ -110,8 +110,6 @@
type="bool"/>
#endif
<preference id="extensions.update.enabled" name="extensions.update.enabled" type="bool"
onchange="gAdvancedPane.updateAddonUpdateUI();"/>
<preference id="browser.search.update" name="browser.search.update" type="bool"/>
<!-- Encryption tab -->
@ -330,10 +328,6 @@
#endif
<groupbox id="updateOthers">
<caption label="&updateOthers.label;"/>
<checkbox id="enableAddonUpdate"
label="&enableAddonsUpdate3.label;"
accesskey="&enableAddonsUpdate3.accesskey;"
preference="extensions.update.enabled"/>
<checkbox id="enableSearchUpdate"
label="&enableSearchUpdate.label;"
accesskey="&enableSearchUpdate.accesskey;"

Просмотреть файл

@ -1352,7 +1352,7 @@ var gApplicationsPane = {
#expand aExecutable.leafName != "__MOZ_APP_NAME__.exe";
#else
#ifdef XP_MACOSX
#expand aExecutable.leafName != "__MOZ_APP_DISPLAYNAME__.app";
#expand aExecutable.leafName != "__MOZ_MACBUNDLE_NAME__";
#else
#expand aExecutable.leafName != "__MOZ_APP_NAME__-bin";
#endif

Просмотреть файл

@ -50,7 +50,7 @@ var gMainPane = {
// set up the "use current page" label-changing listener
this._updateUseCurrentButton();
window.addEventListener("focus", this._updateUseCurrentButton, false);
window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false);
this.updateBrowserStartupLastSession();
this.startupPagePrefChanged();
@ -128,23 +128,13 @@ var gMainPane = {
*/
setHomePageToCurrent: function ()
{
var win;
if (document.documentElement.instantApply) {
// If we're in instant-apply mode, use the most recent browser window
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
win = wm.getMostRecentWindow("navigator:browser");
}
else
win = window.opener;
let homePage = document.getElementById("browser.startup.homepage");
let tabs = this._getTabsForHomePage();
function getTabURI(t) t.linkedBrowser.currentURI.spec;
if (win) {
var homePage = document.getElementById("browser.startup.homepage");
var tabs = win.gBrowser.visibleTabs;
function getTabURI(t) t.linkedBrowser.currentURI.spec;
// FIXME Bug 244192: using dangerous "|" joiner!
// FIXME Bug 244192: using dangerous "|" joiner!
if (tabs.length)
homePage.value = tabs.map(getTabURI).join("|");
}
},
/**
@ -170,10 +160,26 @@ var gMainPane = {
* forms.
*/
_updateUseCurrentButton: function () {
var useCurrent = document.getElementById("useCurrent");
let useCurrent = document.getElementById("useCurrent");
var windowIsPresent;
let tabs = this._getTabsForHomePage();
if (tabs.length > 1)
useCurrent.label = useCurrent.getAttribute("label2");
else
useCurrent.label = useCurrent.getAttribute("label1");
// In this case, the button's disabled state is set by preferences.xml.
if (document.getElementById
("pref.browser.homepage.disable_button.current_page").locked)
return;
useCurrent.disabled = !tabs.length
},
_getTabsForHomePage: function ()
{
var win;
var tabs = [];
if (document.documentElement.instantApply) {
const Cc = Components.classes, Ci = Components.interfaces;
// If we're in instant-apply mode, use the most recent browser window
@ -181,30 +187,17 @@ var gMainPane = {
.getService(Ci.nsIWindowMediator);
win = wm.getMostRecentWindow("navigator:browser");
}
else
else {
win = window.opener;
}
if (win && win.document.documentElement
.getAttribute("windowtype") == "navigator:browser") {
windowIsPresent = true;
var tabbrowser = win.document.getElementById("content");
if (tabbrowser.browsers.length > 1)
useCurrent.label = useCurrent.getAttribute("label2");
else
useCurrent.label = useCurrent.getAttribute("label1");
}
else {
windowIsPresent = false;
useCurrent.label = useCurrent.getAttribute("label1");
// We should only include visible & non-pinned tabs
tabs = win.gBrowser.visibleTabs.slice(win.gBrowser._numPinnedTabs);
}
// In this case, the button's disabled state is set by preferences.xml.
if (document.getElementById
("pref.browser.homepage.disable_button.current_page").locked)
return;
useCurrent.disabled = !windowIsPresent;
return tabs;
},
/**

Просмотреть файл

@ -50,8 +50,6 @@ XPIDLSRCS = \
DIRS = src
ifdef ENABLE_TESTS
DIRS += test/browser
endif
TEST_DIRS = test
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1861,7 +1861,9 @@ SessionStoreService.prototype = {
var entry = { url: aEntry.URI.spec };
try {
aHostSchemeData.push({ host: aEntry.URI.host, scheme: aEntry.URI.scheme });
// throwing is expensive, we know that about: pages will throw
if (entry.url.indexOf("about:") != 0)
aHostSchemeData.push({ host: aEntry.URI.host, scheme: aEntry.URI.scheme });
}
catch (ex) {
// We just won't attempt to get cookies for this entry.
@ -1959,22 +1961,24 @@ SessionStoreService.prototype = {
}
if (aEntry.childCount > 0) {
entry.children = [];
let children = [];
for (var i = 0; i < aEntry.childCount; i++) {
var child = aEntry.GetChildAt(i);
if (child) {
entry.children.push(this._serializeHistoryEntry(child, aFullData,
aIsPinned, aHostSchemeData));
}
else { // to maintain the correct frame order, insert a dummy entry
entry.children.push({ url: "about:blank" });
}
// don't try to restore framesets containing wyciwyg URLs (cf. bug 424689 and bug 450595)
if (/^wyciwyg:\/\//.test(entry.children[i].url)) {
delete entry.children;
break;
// don't try to restore framesets containing wyciwyg URLs (cf. bug 424689 and bug 450595)
if (child.URI.schemeIs("wyciwyg")) {
children = [];
break;
}
children.push(this._serializeHistoryEntry(child, aFullData,
aIsPinned, aHostSchemeData));
}
}
if (children.length)
entry.children = children;
}
return entry;

Просмотреть файл

@ -36,11 +36,11 @@
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../../..
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = browser/components/sessionstore/test/browser
relativesrcdir = browser/components/sessionstore/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
@ -159,6 +159,7 @@ _BROWSER_TEST_FILES = \
browser_687710.js \
browser_687710_2.js \
browser_694378.js \
browser_705597.js \
$(NULL)
ifneq ($(OS_ARCH),Darwin)

Просмотреть файл

@ -116,7 +116,7 @@ function test() {
let rootDir = getRootDirectory(gTestPath);
const testURL = rootDir + "browser_248970_b_sample.html";
const testURL2 = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_248970_b_sample.html";
"browser/components/sessionstore/test/browser_248970_b_sample.html";
// get closed tab count
let count = ss.getClosedTabCount(window);

Просмотреть файл

@ -40,7 +40,7 @@ function test() {
waitForExplicitFinish();
let testURL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_339445_sample.html";
"browser/components/sessionstore/test/browser_339445_sample.html";
let tab = gBrowser.addTab(testURL);
tab.linkedBrowser.addEventListener("load", function(aEvent) {

Просмотреть файл

@ -48,7 +48,7 @@ function test() {
gPrefService.setIntPref("browser.sessionstore.interval", 0);
const testURL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_423132_sample.html";
"browser/components/sessionstore/test/browser_423132_sample.html";
// open a new window
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", "about:blank");

Просмотреть файл

@ -39,7 +39,7 @@ function test() {
waitForExplicitFinish();
const baseURL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_447951_sample.html#";
"browser/components/sessionstore/test/browser_447951_sample.html#";
let tab = gBrowser.addTab();
tab.linkedBrowser.addEventListener("load", function(aEvent) {

Просмотреть файл

@ -40,7 +40,7 @@ function test() {
waitForExplicitFinish();
let testURL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_459906_sample.html";
"browser/components/sessionstore/test/browser_459906_sample.html";
let uniqueValue = "<b>Unique:</b> " + Date.now();
var frameCount = 0;

Просмотреть файл

@ -40,7 +40,7 @@ function test() {
waitForExplicitFinish();
let testURL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_461743_sample.html";
"browser/components/sessionstore/test/browser_461743_sample.html";
let frameCount = 0;
let tab = gBrowser.addTab(testURL);

Просмотреть файл

@ -98,7 +98,7 @@ function test() {
mainURL = testURL;
frame1URL = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_463205_helper.html";
"browser/components/sessionstore/test/browser_463205_helper.html";
frame2URL = rootDir + "browser_463205_helper.html";
frame3URL = "data:text/html,mark2";

Просмотреть файл

@ -18,7 +18,7 @@
else {
frames[1].document.location.hash = "#original";
frames[0].document.location = "http://mochi.test:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_463205_helper.html";
"browser/components/sessionstore/test/browser_463205_helper.html";
}
}, false);
</script>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше