зеркало из https://github.com/mozilla/gecko-dev.git
Merge fx-team to m-c.
This commit is contained in:
Коммит
1286b0b31d
|
@ -9,10 +9,8 @@
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
function doTest()
|
function doTest()
|
||||||
{
|
{
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
var accRetrieval = SpecialPowers.Cc["@mozilla.org/accessibleRetrieval;1"].
|
||||||
|
getService(SpecialPowers.Ci.nsIAccessibleRetrieval);
|
||||||
var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
|
|
||||||
getService(Components.interfaces.nsIAccessibleRetrieval);
|
|
||||||
|
|
||||||
var treecol = document.getElementById("col");
|
var treecol = document.getElementById("col");
|
||||||
var x = treecol.boxObject.screenX;
|
var x = treecol.boxObject.screenX;
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
load 471493.xul
|
# Disabled because it causes assertions/crashes in later crashtests, see bug 918246
|
||||||
|
skip load 471493.xul
|
||||||
|
|
|
@ -874,18 +874,27 @@ SocialToolbar = {
|
||||||
let toggleNotificationsCommand = document.getElementById("Social:ToggleNotifications");
|
let toggleNotificationsCommand = document.getElementById("Social:ToggleNotifications");
|
||||||
toggleNotificationsCommand.setAttribute("hidden", !socialEnabled);
|
toggleNotificationsCommand.setAttribute("hidden", !socialEnabled);
|
||||||
|
|
||||||
let parent = document.getElementById("social-notification-panel");
|
// we need to remove buttons and frames if !socialEnabled or the provider
|
||||||
while (parent.hasChildNodes()) {
|
// has changed (frame origin does not match current provider). We only
|
||||||
let frame = parent.firstChild;
|
// remove frames that are "attached" to buttons in this toolbar button since
|
||||||
SharedFrame.forgetGroup(frame.id);
|
// other buttons may also be using grouped frames.
|
||||||
parent.removeChild(frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
let tbi = document.getElementById("social-provider-button");
|
let tbi = document.getElementById("social-provider-button");
|
||||||
if (tbi) {
|
if (tbi) {
|
||||||
// buttons after social-provider-button are ambient icons
|
// buttons after social-provider-button are ambient icons
|
||||||
while (tbi.nextSibling) {
|
let next = tbi.nextSibling;
|
||||||
tbi.parentNode.removeChild(tbi.nextSibling);
|
let currentOrigin = Social.provider ? Social.provider.origin : null;
|
||||||
|
|
||||||
|
while (next) {
|
||||||
|
let button = next;
|
||||||
|
next = next.nextSibling;
|
||||||
|
// get the frame for this button
|
||||||
|
let frameId = button.getAttribute("notificationFrameId");
|
||||||
|
let frame = document.getElementById(frameId);
|
||||||
|
if (!socialEnabled || frame.getAttribute("origin") != currentOrigin) {
|
||||||
|
SharedFrame.forgetGroup(frame.id);
|
||||||
|
frame.parentNode.removeChild(frame);
|
||||||
|
button.parentNode.removeChild(button);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -259,7 +259,7 @@ panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .a
|
||||||
|
|
||||||
#wrapper-urlbar-container > #urlbar-container > #urlbar {
|
#wrapper-urlbar-container > #urlbar-container > #urlbar {
|
||||||
-moz-user-input: disabled;
|
-moz-user-input: disabled;
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PopupAutoComplete {
|
#PopupAutoComplete {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#placesTreechildren::-moz-tree-cell(grippyRow),
|
#placesTreechildren::-moz-tree-cell(grippyRow),
|
||||||
#placesTreechildren::-moz-tree-cell-text(grippyRow),
|
#placesTreechildren::-moz-tree-cell-text(grippyRow),
|
||||||
#placesTreechildren::-moz-tree-image(grippyRow) {
|
#placesTreechildren::-moz-tree-image(grippyRow) {
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1499,7 +1499,7 @@
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="click-to-play-plugins-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
|
<binding id="click-to-play-plugins-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
|
||||||
<content align="start" class="click-to-play-plugins-notification-content">
|
<content align="start" style="width: &pluginNotification.width;;">
|
||||||
<xul:vbox flex="1" align="stretch" class="popup-notification-main-box"
|
<xul:vbox flex="1" align="stretch" class="popup-notification-main-box"
|
||||||
xbl:inherits="popupid">
|
xbl:inherits="popupid">
|
||||||
<xul:hbox class="click-to-play-plugins-notification-description-box" flex="1" align="start">
|
<xul:hbox class="click-to-play-plugins-notification-description-box" flex="1" align="start">
|
||||||
|
|
|
@ -68,6 +68,23 @@ const IDB = {
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
update: function(project) {
|
||||||
|
let deferred = promise.defer();
|
||||||
|
|
||||||
|
var transaction = IDB._db.transaction(["projects"], "readwrite");
|
||||||
|
var objectStore = transaction.objectStore("projects");
|
||||||
|
var request = objectStore.put(project);
|
||||||
|
request.onerror = function(event) {
|
||||||
|
deferred.reject("Unable to update project to the AppProjects indexedDB: " +
|
||||||
|
this.error.name + " - " + this.error.message );
|
||||||
|
};
|
||||||
|
request.onsuccess = function() {
|
||||||
|
deferred.resolve();
|
||||||
|
};
|
||||||
|
|
||||||
|
return deferred.promise;
|
||||||
|
},
|
||||||
|
|
||||||
remove: function(location) {
|
remove: function(location) {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
|
|
||||||
|
@ -110,6 +127,8 @@ const AppProjects = {
|
||||||
// The packaged app local path is a valid id, but only on the client.
|
// The packaged app local path is a valid id, but only on the client.
|
||||||
// This origin will be used to generate the true id of an app:
|
// This origin will be used to generate the true id of an app:
|
||||||
// its manifest URL.
|
// its manifest URL.
|
||||||
|
// If the app ends up specifying an explicit origin in its manifest,
|
||||||
|
// we will override this random UUID on app install.
|
||||||
packagedAppOrigin: generateUUID().toString().slice(1, -1)
|
packagedAppOrigin: generateUUID().toString().slice(1, -1)
|
||||||
};
|
};
|
||||||
return IDB.add(project).then(function () {
|
return IDB.add(project).then(function () {
|
||||||
|
@ -131,6 +150,14 @@ const AppProjects = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
update: function (project) {
|
||||||
|
return IDB.update({
|
||||||
|
type: project.type,
|
||||||
|
location: project.location,
|
||||||
|
packagedAppOrigin: project.packagedAppOrigin
|
||||||
|
}).then(() => project);
|
||||||
|
},
|
||||||
|
|
||||||
remove: function(location) {
|
remove: function(location) {
|
||||||
return IDB.remove(location).then(function () {
|
return IDB.remove(location).then(function () {
|
||||||
let projects = store.object.projects;
|
let projects = store.object.projects;
|
||||||
|
|
|
@ -208,9 +208,15 @@ let UI = {
|
||||||
},
|
},
|
||||||
|
|
||||||
install: function(project) {
|
install: function(project) {
|
||||||
let install;
|
|
||||||
if (project.type == "packaged") {
|
if (project.type == "packaged") {
|
||||||
install = installPackaged(this.connection.client, this.listTabsResponse.webappsActor, project.location, project.packagedAppOrigin);
|
return installPackaged(this.connection.client, this.listTabsResponse.webappsActor, project.location, project.packagedAppOrigin)
|
||||||
|
.then(({ appId }) => {
|
||||||
|
// If the packaged app specified a custom origin override,
|
||||||
|
// we need to update the local project origin
|
||||||
|
project.packagedAppOrigin = appId;
|
||||||
|
// And ensure the indexed db on disk is also updated
|
||||||
|
AppProjects.update(project);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
let manifestURLObject = Services.io.newURI(project.location, null, null);
|
let manifestURLObject = Services.io.newURI(project.location, null, null);
|
||||||
let origin = Services.io.newURI(manifestURLObject.prePath, null, null);
|
let origin = Services.io.newURI(manifestURLObject.prePath, null, null);
|
||||||
|
@ -219,9 +225,8 @@ let UI = {
|
||||||
origin: origin.spec,
|
origin: origin.spec,
|
||||||
manifestURL: project.location
|
manifestURL: project.location
|
||||||
};
|
};
|
||||||
install = installHosted(this.connection.client, this.listTabsResponse.webappsActor, appId, metadata, project.manifest);
|
return installHosted(this.connection.client, this.listTabsResponse.webappsActor, appId, metadata, project.manifest);
|
||||||
}
|
}
|
||||||
return install;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
start: function(project) {
|
start: function(project) {
|
||||||
|
|
|
@ -4522,6 +4522,7 @@ var Utils = {
|
||||||
case "CSP":
|
case "CSP":
|
||||||
case "Invalid HSTS Headers":
|
case "Invalid HSTS Headers":
|
||||||
case "Insecure Password Field":
|
case "Insecure Password Field":
|
||||||
|
case "SSL":
|
||||||
return CATEGORY_SECURITY;
|
return CATEGORY_SECURITY;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -672,6 +672,13 @@ just addresses the organization to follow, e.g. "This site is run by " -->
|
||||||
<!ENTITY pluginActivateAlways.label "Allow and Remember">
|
<!ENTITY pluginActivateAlways.label "Allow and Remember">
|
||||||
<!ENTITY pluginBlockNow.label "Block Plugin">
|
<!ENTITY pluginBlockNow.label "Block Plugin">
|
||||||
|
|
||||||
|
<!-- LOCALIZATION NOTE: (pluginNotification.width): This is used to determine the
|
||||||
|
width of the plugin popup notification that can appear if a plugin has been
|
||||||
|
blocked on a page. Should be wide enough to fit the pluginActivateNow.label
|
||||||
|
and pluginActivateAlways.label strings above on a single line. This must be
|
||||||
|
a CSS length value. -->
|
||||||
|
<!ENTITY pluginNotification.width "28em">
|
||||||
|
|
||||||
<!ENTITY tabCrashed.header "Tab crashed">
|
<!ENTITY tabCrashed.header "Tab crashed">
|
||||||
<!ENTITY tabCrashed.message "Well, this is embarrassing. We tried to display this Web page, but it's not responding.">
|
<!ENTITY tabCrashed.message "Well, this is embarrassing. We tried to display this Web page, but it's not responding.">
|
||||||
<!ENTITY tabCrashed.checkSendReport "Tell &vendorShortName; about this crash so they can fix it.">
|
<!ENTITY tabCrashed.checkSendReport "Tell &vendorShortName; about this crash so they can fix it.">
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.click-to-play-plugins-notification-content {
|
|
||||||
width: 28em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.click-to-play-plugins-notification-center-box {
|
.click-to-play-plugins-notification-center-box {
|
||||||
border: 1px solid ThreeDShadow;
|
border: 1px solid ThreeDShadow;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
|
@ -737,6 +737,14 @@ public:
|
||||||
return sXPConnect;
|
return sXPConnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report simple error message to the browser console
|
||||||
|
* @param aErrorText the error message
|
||||||
|
* @param classification Name of the module reporting error
|
||||||
|
*/
|
||||||
|
static void LogSimpleConsoleError(const nsAString& aErrorText,
|
||||||
|
const char * classification);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report a non-localized error message to the error console.
|
* Report a non-localized error message to the error console.
|
||||||
* @param aErrorText the error message
|
* @param aErrorText the error message
|
||||||
|
|
|
@ -3014,6 +3014,24 @@ nsresult nsContentUtils::FormatLocalizedString(PropertiesFile aFile,
|
||||||
getter_Copies(aResult));
|
getter_Copies(aResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
nsContentUtils::LogSimpleConsoleError(const nsAString& aErrorText,
|
||||||
|
const char * classification)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIScriptError> scriptError =
|
||||||
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
||||||
|
if (scriptError) {
|
||||||
|
nsCOMPtr<nsIConsoleService> console =
|
||||||
|
do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
||||||
|
if (console && NS_SUCCEEDED(scriptError->Init(aErrorText, EmptyString(),
|
||||||
|
EmptyString(), 0, 0,
|
||||||
|
nsIScriptError::errorFlag,
|
||||||
|
classification))) {
|
||||||
|
console->LogMessage(scriptError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* static */ nsresult
|
/* static */ nsresult
|
||||||
nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
||||||
const nsACString& aCategory,
|
const nsACString& aCategory,
|
||||||
|
|
|
@ -1,22 +1,25 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML">
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML" class="reftest-wait">
|
||||||
<mathml:mfenced/>
|
<mathml:mfenced/>
|
||||||
|
|
||||||
|
|
||||||
<script><![CDATA[
|
<script><![CDATA[
|
||||||
var docviewer;
|
var docviewer;
|
||||||
function do_onload() {
|
function do_onload() {
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
var navigator1 = SpecialPowers.wrap(parent).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).getInterface(SpecialPowers.Ci.nsIWebNavigation);
|
||||||
var navigator1 = parent.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
|
var docShell = navigator1.QueryInterface(SpecialPowers.Ci.nsIDocShell);
|
||||||
var docShell = navigator1.QueryInterface(Components.interfaces.nsIDocShell);
|
docviewer = docShell.contentViewer.QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
|
||||||
docviewer = docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
|
|
||||||
|
|
||||||
setTimeout(function() {window.location.reload()}, 500);
|
setTimeout(function() {
|
||||||
|
clearTimeout(timer);
|
||||||
|
docviewer.textZoom = 1;
|
||||||
|
document.documentElement.removeAttribute("class");
|
||||||
|
}, 500);
|
||||||
setTimeout(doe,50, 0.2);
|
setTimeout(doe,50, 0.2);
|
||||||
}
|
}
|
||||||
do_onload();
|
do_onload();
|
||||||
|
|
||||||
|
var timer;
|
||||||
function doe(i) {
|
function doe(i) {
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
docviewer.textZoom += i;
|
docviewer.textZoom += i;
|
||||||
|
|
||||||
if (docviewer.textZoom >=4)
|
if (docviewer.textZoom >=4)
|
||||||
|
@ -25,7 +28,7 @@ if (docviewer.textZoom >=4)
|
||||||
if (docviewer.textZoom <=0)
|
if (docviewer.textZoom <=0)
|
||||||
i = 0.2;
|
i = 0.2;
|
||||||
window.status = docviewer.textZoom;
|
window.status = docviewer.textZoom;
|
||||||
setTimeout(doe, 50, i);
|
timer = setTimeout(doe, 50, i);
|
||||||
}
|
}
|
||||||
]]></script>
|
]]></script>
|
||||||
</html>
|
</html>
|
|
@ -201,6 +201,7 @@
|
||||||
|
|
||||||
<activity android:name="org.mozilla.gecko.Restarter"
|
<activity android:name="org.mozilla.gecko.Restarter"
|
||||||
android:process="@ANDROID_PACKAGE_NAME@Restarter"
|
android:process="@ANDROID_PACKAGE_NAME@Restarter"
|
||||||
|
android:noHistory="true"
|
||||||
android:theme="@style/Gecko">
|
android:theme="@style/Gecko">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="org.mozilla.gecko.restart"/>
|
<action android:name="org.mozilla.gecko.restart"/>
|
||||||
|
|
|
@ -2268,10 +2268,14 @@ abstract public class BrowserApp extends GeckoApp
|
||||||
// HomePager.OnNewTabsListener
|
// HomePager.OnNewTabsListener
|
||||||
@Override
|
@Override
|
||||||
public void onNewTabs(String[] urls) {
|
public void onNewTabs(String[] urls) {
|
||||||
|
final EnumSet<OnUrlOpenListener.Flags> flags = EnumSet.of(OnUrlOpenListener.Flags.ALLOW_SWITCH_TO_TAB);
|
||||||
|
|
||||||
for (String url : urls) {
|
for (String url : urls) {
|
||||||
|
if (!maybeSwitchToTab(url, flags)) {
|
||||||
openUrl(url, true);
|
openUrl(url, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HomePager.OnUrlOpenListener
|
// HomePager.OnUrlOpenListener
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2132,8 +2132,6 @@ abstract public class GeckoApp
|
||||||
Intent intent = new Intent(action);
|
Intent intent = new Intent(action);
|
||||||
intent.setClassName(AppConstants.ANDROID_PACKAGE_NAME, RESTARTER_CLASS);
|
intent.setClassName(AppConstants.ANDROID_PACKAGE_NAME, RESTARTER_CLASS);
|
||||||
/* TODO: addEnvToIntent(intent); */
|
/* TODO: addEnvToIntent(intent); */
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
|
|
||||||
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
|
||||||
if (args != null)
|
if (args != null)
|
||||||
intent.putExtra("args", args);
|
intent.putExtra("args", args);
|
||||||
intent.putExtra("didRestart", true);
|
intent.putExtra("didRestart", true);
|
||||||
|
|
|
@ -666,7 +666,6 @@ RES_DRAWABLE_MDPI = \
|
||||||
res/drawable-mdpi/icon_most_recent.png \
|
res/drawable-mdpi/icon_most_recent.png \
|
||||||
res/drawable-mdpi/icon_most_recent_empty.png \
|
res/drawable-mdpi/icon_most_recent_empty.png \
|
||||||
res/drawable-mdpi/icon_most_visited.png \
|
res/drawable-mdpi/icon_most_visited.png \
|
||||||
res/drawable-mdpi/icon_most_visited_empty.png \
|
|
||||||
res/drawable-mdpi/icon_openinapp.png \
|
res/drawable-mdpi/icon_openinapp.png \
|
||||||
res/drawable-mdpi/icon_pageaction.png \
|
res/drawable-mdpi/icon_pageaction.png \
|
||||||
res/drawable-mdpi/icon_reading_list_empty.png \
|
res/drawable-mdpi/icon_reading_list_empty.png \
|
||||||
|
@ -782,7 +781,6 @@ RES_DRAWABLE_HDPI = \
|
||||||
res/drawable-hdpi/icon_most_recent.png \
|
res/drawable-hdpi/icon_most_recent.png \
|
||||||
res/drawable-hdpi/icon_most_recent_empty.png \
|
res/drawable-hdpi/icon_most_recent_empty.png \
|
||||||
res/drawable-hdpi/icon_most_visited.png \
|
res/drawable-hdpi/icon_most_visited.png \
|
||||||
res/drawable-hdpi/icon_most_visited_empty.png \
|
|
||||||
res/drawable-hdpi/icon_openinapp.png \
|
res/drawable-hdpi/icon_openinapp.png \
|
||||||
res/drawable-hdpi/icon_pageaction.png \
|
res/drawable-hdpi/icon_pageaction.png \
|
||||||
res/drawable-hdpi/icon_reading_list_empty.png \
|
res/drawable-hdpi/icon_reading_list_empty.png \
|
||||||
|
@ -884,7 +882,6 @@ RES_DRAWABLE_XHDPI = \
|
||||||
res/drawable-xhdpi/icon_most_recent.png \
|
res/drawable-xhdpi/icon_most_recent.png \
|
||||||
res/drawable-xhdpi/icon_most_recent_empty.png \
|
res/drawable-xhdpi/icon_most_recent_empty.png \
|
||||||
res/drawable-xhdpi/icon_most_visited.png \
|
res/drawable-xhdpi/icon_most_visited.png \
|
||||||
res/drawable-xhdpi/icon_most_visited_empty.png \
|
|
||||||
res/drawable-xhdpi/icon_openinapp.png \
|
res/drawable-xhdpi/icon_openinapp.png \
|
||||||
res/drawable-xhdpi/icon_pageaction.png \
|
res/drawable-xhdpi/icon_pageaction.png \
|
||||||
res/drawable-xhdpi/icon_reading_list_empty.png \
|
res/drawable-xhdpi/icon_reading_list_empty.png \
|
||||||
|
|
|
@ -15,6 +15,8 @@ public class Restarter extends Activity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
Log.i(LOGTAG, "Trying to restart " + AppConstants.MOZ_APP_NAME);
|
Log.i(LOGTAG, "Trying to restart " + AppConstants.MOZ_APP_NAME);
|
||||||
try {
|
try {
|
||||||
int countdown = 40;
|
int countdown = 40;
|
||||||
|
@ -46,15 +48,10 @@ public class Restarter extends Activity {
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
if (b != null)
|
if (b != null)
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
||||||
Log.i(LOGTAG, intent.toString());
|
Log.i(LOGTAG, intent.toString());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i(LOGTAG, e.toString());
|
Log.i(LOGTAG, e.toString());
|
||||||
}
|
}
|
||||||
// Give the new process time to start before we die
|
|
||||||
GeckoAppShell.waitForAnotherGeckoProc();
|
|
||||||
System.exit(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,11 +47,8 @@ import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewStub;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
@ -87,9 +84,6 @@ public class TopSitesPage extends HomeFragment {
|
||||||
// Grid of top sites
|
// Grid of top sites
|
||||||
private TopSitesGridView mGrid;
|
private TopSitesGridView mGrid;
|
||||||
|
|
||||||
// Reference to the View to display when there are no results.
|
|
||||||
private View mEmptyView;
|
|
||||||
|
|
||||||
// Banner to show snippets.
|
// Banner to show snippets.
|
||||||
private HomeBanner mBanner;
|
private HomeBanner mBanner;
|
||||||
|
|
||||||
|
@ -224,7 +218,6 @@ public class TopSitesPage extends HomeFragment {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
mList = null;
|
mList = null;
|
||||||
mGrid = null;
|
mGrid = null;
|
||||||
mEmptyView = null;
|
|
||||||
mListAdapter = null;
|
mListAdapter = null;
|
||||||
mGridAdapter = null;
|
mGridAdapter = null;
|
||||||
}
|
}
|
||||||
|
@ -466,20 +459,6 @@ public class TopSitesPage extends HomeFragment {
|
||||||
if (c != null && c.getCount() > 0) {
|
if (c != null && c.getCount() > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEmptyView == null) {
|
|
||||||
// Set empty page view. We delay this so that the empty view won't flash.
|
|
||||||
ViewStub emptyViewStub = (ViewStub) getView().findViewById(R.id.home_empty_view_stub);
|
|
||||||
mEmptyView = emptyViewStub.inflate();
|
|
||||||
|
|
||||||
final ImageView emptyIcon = (ImageView) mEmptyView.findViewById(R.id.home_empty_image);
|
|
||||||
emptyIcon.setImageResource(R.drawable.icon_most_visited_empty);
|
|
||||||
|
|
||||||
final TextView emptyText = (TextView) mEmptyView.findViewById(R.id.home_empty_text);
|
|
||||||
emptyText.setText(R.string.home_most_visited_empty);
|
|
||||||
|
|
||||||
mList.setEmptyView(mEmptyView);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TopSitesLoader extends SimpleCursorLoader {
|
private static class TopSitesLoader extends SimpleCursorLoader {
|
||||||
|
|
|
@ -280,7 +280,6 @@ size. -->
|
||||||
<!ENTITY home_last_tabs_empty "Your recent tabs show up here.">
|
<!ENTITY home_last_tabs_empty "Your recent tabs show up here.">
|
||||||
<!ENTITY home_most_recent_title "Most recent">
|
<!ENTITY home_most_recent_title "Most recent">
|
||||||
<!ENTITY home_most_recent_empty "Websites you visited most recently show up here.">
|
<!ENTITY home_most_recent_empty "Websites you visited most recently show up here.">
|
||||||
<!ENTITY home_most_visited_title "Most visited">
|
|
||||||
<!ENTITY home_reading_list_empty "Articles you save for later show up here.">
|
<!ENTITY home_reading_list_empty "Articles you save for later show up here.">
|
||||||
<!-- Localization note (home_reading_list_hint): The "TIP" string is synonymous to "hint", "clue", etc. This string is displayed
|
<!-- Localization note (home_reading_list_hint): The "TIP" string is synonymous to "hint", "clue", etc. This string is displayed
|
||||||
as an advisory message on how to add content to the reading list when the reading list empty.
|
as an advisory message on how to add content to the reading list when the reading list empty.
|
||||||
|
@ -291,7 +290,6 @@ size. -->
|
||||||
as alternate text for accessibility. It is not visible in the UI. -->
|
as alternate text for accessibility. It is not visible in the UI. -->
|
||||||
<!ENTITY home_reading_list_hint_accessible "TIP: Save articles to your reading list by long pressing the reader mode button when it appears in the title bar.">
|
<!ENTITY home_reading_list_hint_accessible "TIP: Save articles to your reading list by long pressing the reader mode button when it appears in the title bar.">
|
||||||
|
|
||||||
<!ENTITY home_most_visited_empty "Websites you visit most frequently show up here.">
|
|
||||||
<!ENTITY pin_site_dialog_hint "Enter a search keyword">
|
<!ENTITY pin_site_dialog_hint "Enter a search keyword">
|
||||||
|
|
||||||
<!ENTITY filepicker_title "Choose File">
|
<!ENTITY filepicker_title "Choose File">
|
||||||
|
|
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.3 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 808 B |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.7 KiB |
|
@ -6,7 +6,7 @@
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/url_bar_bg">
|
android:background="@color/background_light">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/prompt"
|
<LinearLayout android:id="@+id/prompt"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
@ -20,16 +20,15 @@
|
||||||
<TextView android:id="@+id/suggestions_prompt_title"
|
<TextView android:id="@+id/suggestions_prompt_title"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:textColor="@color/url_bar_title"
|
|
||||||
android:layout_marginLeft="6dip"
|
android:layout_marginLeft="6dip"
|
||||||
android:textSize="14sp"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1" />
|
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"/>
|
||||||
|
|
||||||
<TextView android:id="@+id/suggestions_prompt_yes"
|
<TextView android:id="@+id/suggestions_prompt_yes"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="14sp"
|
|
||||||
android:layout_marginLeft="15dip"
|
android:layout_marginLeft="15dip"
|
||||||
|
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"
|
||||||
android:background="@drawable/suggestion_selector"
|
android:background="@drawable/suggestion_selector"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
|
@ -41,8 +40,8 @@
|
||||||
<TextView android:id="@+id/suggestions_prompt_no"
|
<TextView android:id="@+id/suggestions_prompt_no"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="14sp"
|
|
||||||
android:layout_marginLeft="6dip"
|
android:layout_marginLeft="6dip"
|
||||||
|
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"
|
||||||
android:background="@drawable/suggestion_selector"
|
android:background="@drawable/suggestion_selector"
|
||||||
android:nextFocusRight="@+id/suggestions_prompt_no"
|
android:nextFocusRight="@+id/suggestions_prompt_no"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
|
|
|
@ -8,11 +8,6 @@
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ViewStub android:id="@+id/home_empty_view_stub"
|
|
||||||
android:layout="@layout/home_empty_page"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"/>
|
|
||||||
|
|
||||||
<org.mozilla.gecko.home.HomeListView
|
<org.mozilla.gecko.home.HomeListView
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
style="@style/Widget.TopSitesListView"
|
style="@style/Widget.TopSitesListView"
|
||||||
|
|
|
@ -312,6 +312,10 @@
|
||||||
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.Widget.SuggestionsPrompt" parent="TextAppearance.Small">
|
||||||
|
<item name="android:textColor">@color/url_bar_title</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.Widget.Home" />
|
<style name="TextAppearance.Widget.Home" />
|
||||||
|
|
||||||
<style name="TextAppearance.Widget.Home.Header" parent="TextAppearance.Small">
|
<style name="TextAppearance.Widget.Home.Header" parent="TextAppearance.Small">
|
||||||
|
|
|
@ -259,8 +259,6 @@
|
||||||
<string name="home_last_tabs_empty">&home_last_tabs_empty;</string>
|
<string name="home_last_tabs_empty">&home_last_tabs_empty;</string>
|
||||||
<string name="home_most_recent_title">&home_most_recent_title;</string>
|
<string name="home_most_recent_title">&home_most_recent_title;</string>
|
||||||
<string name="home_most_recent_empty">&home_most_recent_empty;</string>
|
<string name="home_most_recent_empty">&home_most_recent_empty;</string>
|
||||||
<string name="home_most_visited_title">&home_most_visited_title;</string>
|
|
||||||
<string name="home_most_visited_empty">&home_most_visited_empty;</string>
|
|
||||||
<string name="home_reading_list_empty">&home_reading_list_empty;</string>
|
<string name="home_reading_list_empty">&home_reading_list_empty;</string>
|
||||||
<string name="home_reading_list_hint">&home_reading_list_hint;</string>
|
<string name="home_reading_list_hint">&home_reading_list_hint;</string>
|
||||||
<string name="home_reading_list_hint_accessible">&home_reading_list_hint_accessible;</string>
|
<string name="home_reading_list_hint_accessible">&home_reading_list_hint_accessible;</string>
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
<!DOCTYPE html [
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||||
|
%htmlDTD;
|
||||||
|
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||||||
|
%brandDTD;
|
||||||
|
<!ENTITY % abouthomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
|
||||||
|
%abouthomeDTD;
|
||||||
|
]>
|
||||||
|
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@ -9,6 +15,7 @@
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
|
<title>&abouthome.title;</title>
|
||||||
<link rel="icon" type="image/png" sizes="64x64" href="chrome://branding/content/favicon64.png" />
|
<link rel="icon" type="image/png" sizes="64x64" href="chrome://branding/content/favicon64.png" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
|
<title>&privatebrowsingpage.title;</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1; user-scalable=no"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1; user-scalable=no"/>
|
||||||
<link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
|
<link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
|
||||||
<link rel="icon" type="image/png" href="chrome://branding/content/favicon32.png" />
|
<link rel="icon" type="image/png" href="chrome://branding/content/favicon32.png" />
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
|
|
||||||
|
<!ENTITY abouthome.title "&brandShortName; Home">
|
|
@ -14,6 +14,7 @@
|
||||||
locale/@AB_CD@/browser/aboutDownloads.dtd (%chrome/aboutDownloads.dtd)
|
locale/@AB_CD@/browser/aboutDownloads.dtd (%chrome/aboutDownloads.dtd)
|
||||||
locale/@AB_CD@/browser/aboutDownloads.properties (%chrome/aboutDownloads.properties)
|
locale/@AB_CD@/browser/aboutDownloads.properties (%chrome/aboutDownloads.properties)
|
||||||
locale/@AB_CD@/browser/aboutFeedback.dtd (%chrome/aboutFeedback.dtd)
|
locale/@AB_CD@/browser/aboutFeedback.dtd (%chrome/aboutFeedback.dtd)
|
||||||
|
locale/@AB_CD@/browser/aboutHome.dtd (%chrome/aboutHome.dtd)
|
||||||
locale/@AB_CD@/browser/aboutPrivateBrowsing.dtd (%chrome/aboutPrivateBrowsing.dtd)
|
locale/@AB_CD@/browser/aboutPrivateBrowsing.dtd (%chrome/aboutPrivateBrowsing.dtd)
|
||||||
locale/@AB_CD@/browser/aboutReader.properties (%chrome/aboutReader.properties)
|
locale/@AB_CD@/browser/aboutReader.properties (%chrome/aboutReader.properties)
|
||||||
#ifdef MOZ_SERVICES_HEALTHREPORT
|
#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||||
|
|
|
@ -113,9 +113,9 @@
|
||||||
#include "nsXPCOMCIDInternal.h"
|
#include "nsXPCOMCIDInternal.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsIConsoleService.h"
|
|
||||||
#include "PSMRunnable.h"
|
#include "PSMRunnable.h"
|
||||||
#include "SharedSSLState.h"
|
#include "SharedSSLState.h"
|
||||||
|
#include "nsContentUtils.h"
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "secerr.h"
|
#include "secerr.h"
|
||||||
|
@ -213,11 +213,7 @@ LogInvalidCertError(TransportSecurityInfo *socketInfo,
|
||||||
socketInfo->GetErrorLogMessage(errorCode, errorMessageType, message);
|
socketInfo->GetErrorLogMessage(errorCode, errorMessageType, message);
|
||||||
|
|
||||||
if (!message.IsEmpty()) {
|
if (!message.IsEmpty()) {
|
||||||
nsCOMPtr<nsIConsoleService> console;
|
nsContentUtils::LogSimpleConsoleError(message, "SSL");
|
||||||
console = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
|
||||||
if (console) {
|
|
||||||
console->LogStringMessage(message.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "nsProxyRelease.h"
|
#include "nsProxyRelease.h"
|
||||||
#include "PSMRunnable.h"
|
#include "PSMRunnable.h"
|
||||||
#include "ScopedNSSTypes.h"
|
#include "ScopedNSSTypes.h"
|
||||||
#include "nsIConsoleService.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIHttpChannelInternal.h"
|
#include "nsIHttpChannelInternal.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "SharedSSLState.h"
|
#include "SharedSSLState.h"
|
||||||
|
@ -1042,16 +1042,14 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) {
|
||||||
// localized.
|
// localized.
|
||||||
if (!siteSupportsSafeRenego &&
|
if (!siteSupportsSafeRenego &&
|
||||||
ioLayerHelpers.getWarnLevelMissingRFC5746() > 0) {
|
ioLayerHelpers.getWarnLevelMissingRFC5746() > 0) {
|
||||||
nsCOMPtr<nsIConsoleService> console = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
|
||||||
if (console) {
|
|
||||||
nsXPIDLCString hostName;
|
nsXPIDLCString hostName;
|
||||||
infoObject->GetHostName(getter_Copies(hostName));
|
infoObject->GetHostName(getter_Copies(hostName));
|
||||||
|
|
||||||
nsAutoString msg;
|
nsAutoString msg;
|
||||||
msg.Append(NS_ConvertASCIItoUTF16(hostName));
|
msg.Append(NS_ConvertASCIItoUTF16(hostName));
|
||||||
msg.Append(NS_LITERAL_STRING(" : server does not support RFC 5746, see CVE-2009-3555"));
|
msg.Append(NS_LITERAL_STRING(" : server does not support RFC 5746, see CVE-2009-3555"));
|
||||||
console->LogStringMessage(msg.get());
|
|
||||||
}
|
nsContentUtils::LogSimpleConsoleError(msg, "SSL");
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedCERTCertificate serverCert(SSL_PeerCertificate(fd));
|
ScopedCERTCertificate serverCert(SSL_PeerCertificate(fd));
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "ScopedNSSTypes.h"
|
#include "ScopedNSSTypes.h"
|
||||||
#include "SharedSSLState.h"
|
#include "SharedSSLState.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
|
#include "nsContentUtils.h"
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "secerr.h"
|
#include "secerr.h"
|
||||||
|
@ -668,11 +669,7 @@ nsHandleSSLError(nsNSSSocketInfo *socketInfo,
|
||||||
socketInfo->GetErrorLogMessage(err, errtype, errorString);
|
socketInfo->GetErrorLogMessage(err, errtype, errorString);
|
||||||
|
|
||||||
if (!errorString.IsEmpty()) {
|
if (!errorString.IsEmpty()) {
|
||||||
nsCOMPtr<nsIConsoleService> console;
|
nsContentUtils::LogSimpleConsoleError(errorString, "SSL");
|
||||||
console = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
|
||||||
if (console) {
|
|
||||||
console->LogStringMessage(errorString.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
include ../../testing/crashtest/sanity/crashtests.list
|
include ../../testing/crashtest/sanity/crashtests.list
|
||||||
|
|
||||||
|
include ../../accessible/tests/crashtests/crashtests.list
|
||||||
|
|
||||||
include ../../content/base/crashtests/crashtests.list
|
include ../../content/base/crashtests/crashtests.list
|
||||||
include ../../content/canvas/crashtests/crashtests.list
|
include ../../content/canvas/crashtests/crashtests.list
|
||||||
include ../../content/events/crashtests/crashtests.list
|
include ../../content/events/crashtests/crashtests.list
|
||||||
|
|
|
@ -338,8 +338,8 @@ Download.prototype = {
|
||||||
// While shutting down or disposing of this object, we prevent the download
|
// While shutting down or disposing of this object, we prevent the download
|
||||||
// from returning to be in progress.
|
// from returning to be in progress.
|
||||||
if (this._finalized) {
|
if (this._finalized) {
|
||||||
return Promise.reject(new DownloadError(Cr.NS_ERROR_FAILURE,
|
return Promise.reject(new DownloadError({
|
||||||
"Cannot start after finalization."));
|
message: "Cannot start after finalization."}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize all the status properties for a new or restarted download.
|
// Initialize all the status properties for a new or restarted download.
|
||||||
|
@ -408,15 +408,12 @@ Download.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Disallow download if parental controls service restricts it.
|
// Disallow download if parental controls service restricts it.
|
||||||
if (yield DownloadIntegration.shouldBlockForParentalControls(this)) {
|
if (yield DownloadIntegration.shouldBlockForParentalControls(this)) {
|
||||||
let error = new DownloadError(Cr.NS_ERROR_FAILURE, "Download blocked.");
|
throw new DownloadError({ becauseBlockedByParentalControls: true });
|
||||||
error.becauseBlocked = true;
|
|
||||||
error.becauseBlockedByParentalControls = true;
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
// Execute the actual download through the saver object.
|
// Execute the actual download through the saver object.
|
||||||
yield this.saver.execute(DS_setProgressBytes.bind(this),
|
yield this.saver.execute(DS_setProgressBytes.bind(this),
|
||||||
DS_setProperties.bind(this));
|
DS_setProperties.bind(this));
|
||||||
|
@ -430,7 +427,16 @@ Download.prototype = {
|
||||||
// is forced to actually check the status properties to see if the
|
// is forced to actually check the status properties to see if the
|
||||||
// download was canceled or failed because of other reasons.
|
// download was canceled or failed because of other reasons.
|
||||||
if (this._promiseCanceled) {
|
if (this._promiseCanceled) {
|
||||||
throw new DownloadError(Cr.NS_ERROR_FAILURE, "Download canceled.");
|
throw new DownloadError({ message: "Download canceled." });
|
||||||
|
}
|
||||||
|
|
||||||
|
// An HTTP 450 error code is used by Windows to indicate that a uri is
|
||||||
|
// blocked by parental controls. This will prevent the download from
|
||||||
|
// occuring, so an error needs to be raised. This is not performed
|
||||||
|
// during the parental controls check above as it requires the request
|
||||||
|
// to start.
|
||||||
|
if (this._blockedByParentalControls) {
|
||||||
|
ex = new DownloadError({ becauseBlockedByParentalControls: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the download error, unless a new attempt already started. The
|
// Update the download error, unless a new attempt already started. The
|
||||||
|
@ -475,7 +481,7 @@ Download.prototype = {
|
||||||
|
|
||||||
// Notify the new download state before returning.
|
// Notify the new download state before returning.
|
||||||
this._notifyChange();
|
this._notifyChange();
|
||||||
return this._currentAttempt;
|
return currentAttempt;
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1152,18 +1158,22 @@ DownloadTarget.fromSerializable = function (aSerializable) {
|
||||||
/**
|
/**
|
||||||
* Provides detailed information about a download failure.
|
* Provides detailed information about a download failure.
|
||||||
*
|
*
|
||||||
* @param aResult
|
* @param aProperties
|
||||||
* The result code associated with the error.
|
* Object which may contain any of the following properties:
|
||||||
* @param aMessage
|
* {
|
||||||
* The message to be displayed, or null to use the message associated
|
* result: Result error code, defaulting to Cr.NS_ERROR_FAILURE
|
||||||
* with the result code.
|
* message: String error message to be displayed, or null to use the
|
||||||
* @param aInferCause
|
* message associated with the result code.
|
||||||
* If true, attempts to determine if the cause of the download is a
|
* inferCause: If true, attempts to determine if the cause of the
|
||||||
* network failure or a local file failure, based on a set of known
|
* download is a network failure or a local file failure,
|
||||||
* values of the result code. This is useful when the error is received
|
* based on a set of known values of the result code.
|
||||||
* by a component that handles both aspects of the download.
|
* This is useful when the error is received by a
|
||||||
|
* component that handles both aspects of the download.
|
||||||
|
* }
|
||||||
|
* The properties object may also contain any of the DownloadError's
|
||||||
|
* because properties, which will be set accordingly in the error object.
|
||||||
*/
|
*/
|
||||||
function DownloadError(aResult, aMessage, aInferCause)
|
function DownloadError(aProperties)
|
||||||
{
|
{
|
||||||
const NS_ERROR_MODULE_BASE_OFFSET = 0x45;
|
const NS_ERROR_MODULE_BASE_OFFSET = 0x45;
|
||||||
const NS_ERROR_MODULE_NETWORK = 6;
|
const NS_ERROR_MODULE_NETWORK = 6;
|
||||||
|
@ -1171,18 +1181,39 @@ function DownloadError(aResult, aMessage, aInferCause)
|
||||||
|
|
||||||
// Set the error name used by the Error object prototype first.
|
// Set the error name used by the Error object prototype first.
|
||||||
this.name = "DownloadError";
|
this.name = "DownloadError";
|
||||||
this.result = aResult || Cr.NS_ERROR_FAILURE;
|
this.result = aProperties.result || Cr.NS_ERROR_FAILURE;
|
||||||
if (aMessage) {
|
if (aProperties.message) {
|
||||||
this.message = aMessage;
|
this.message = aProperties.message;
|
||||||
|
} else if (aProperties.becauseBlocked ||
|
||||||
|
aProperties.becauseBlockedByParentalControls) {
|
||||||
|
this.message = "Download blocked.";
|
||||||
} else {
|
} else {
|
||||||
let exception = new Components.Exception("", this.result);
|
let exception = new Components.Exception("", this.result);
|
||||||
this.message = exception.toString();
|
this.message = exception.toString();
|
||||||
}
|
}
|
||||||
if (aInferCause) {
|
if (aProperties.inferCause) {
|
||||||
let module = ((aResult & 0x7FFF0000) >> 16) - NS_ERROR_MODULE_BASE_OFFSET;
|
let module = ((this.result & 0x7FFF0000) >> 16) -
|
||||||
|
NS_ERROR_MODULE_BASE_OFFSET;
|
||||||
this.becauseSourceFailed = (module == NS_ERROR_MODULE_NETWORK);
|
this.becauseSourceFailed = (module == NS_ERROR_MODULE_NETWORK);
|
||||||
this.becauseTargetFailed = (module == NS_ERROR_MODULE_FILES);
|
this.becauseTargetFailed = (module == NS_ERROR_MODULE_FILES);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (aProperties.becauseSourceFailed) {
|
||||||
|
this.becauseSourceFailed = true;
|
||||||
|
}
|
||||||
|
if (aProperties.becauseTargetFailed) {
|
||||||
|
this.becauseTargetFailed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aProperties.becauseBlockedByParentalControls) {
|
||||||
|
this.becauseBlocked = true;
|
||||||
|
this.becauseBlockedByParentalControls = true;
|
||||||
|
}
|
||||||
|
else if (aProperties.becauseBlocked) {
|
||||||
|
this.becauseBlocked = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.stack = new Error().stack;
|
this.stack = new Error().stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1309,6 +1340,31 @@ DownloadSaver.prototype = {
|
||||||
targetUri);
|
targetUri);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the request's response has been blocked by Windows parental
|
||||||
|
* controls with an HTTP 450 error code.
|
||||||
|
*
|
||||||
|
* @param aRequest
|
||||||
|
* nsIRequest object
|
||||||
|
* @return True if the response is blocked.
|
||||||
|
*/
|
||||||
|
isResponseParentalBlocked: function(aRequest)
|
||||||
|
{
|
||||||
|
// If the HTTP status is 450, then Windows Parental Controls have
|
||||||
|
// blocked this download.
|
||||||
|
if (aRequest instanceof Ci.nsIHttpChannel &&
|
||||||
|
aRequest.responseStatus == 450) {
|
||||||
|
// Cancel the request, but set a flag on the download that can be
|
||||||
|
// retrieved later when handling the cancellation so that the proper
|
||||||
|
// blocked by parental controls error can be thrown.
|
||||||
|
this.download._blockedByParentalControls = true;
|
||||||
|
aRequest.cancel(Cr.NS_BINDING_ABORTED);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a static representation of the current object state.
|
* Returns a static representation of the current object state.
|
||||||
*
|
*
|
||||||
|
@ -1420,7 +1476,7 @@ DownloadCopySaver.prototype = {
|
||||||
// Throw a DownloadError indicating that the operation failed because of
|
// Throw a DownloadError indicating that the operation failed because of
|
||||||
// the target file. We cannot translate this into a specific result
|
// the target file. We cannot translate this into a specific result
|
||||||
// code, but we preserve the original message using the toString method.
|
// code, but we preserve the original message using the toString method.
|
||||||
let error = new DownloadError(Cr.NS_ERROR_FAILURE, ex.toString());
|
let error = new DownloadError({ message: ex.toString() });
|
||||||
error.becauseTargetFailed = true;
|
error.becauseTargetFailed = true;
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
@ -1431,7 +1487,7 @@ DownloadCopySaver.prototype = {
|
||||||
if (this._canceled) {
|
if (this._canceled) {
|
||||||
// Don't create the BackgroundFileSaver object if we have been
|
// Don't create the BackgroundFileSaver object if we have been
|
||||||
// canceled meanwhile.
|
// canceled meanwhile.
|
||||||
throw new DownloadError(Cr.NS_ERROR_FAILURE, "Saver canceled.");
|
throw new DownloadError({ message: "Saver canceled." });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the object that will save the file in a background thread.
|
// Create the object that will save the file in a background thread.
|
||||||
|
@ -1453,8 +1509,8 @@ DownloadCopySaver.prototype = {
|
||||||
} else {
|
} else {
|
||||||
// Infer the origin of the error from the failure code, because
|
// Infer the origin of the error from the failure code, because
|
||||||
// BackgroundFileSaver does not provide more specific data.
|
// BackgroundFileSaver does not provide more specific data.
|
||||||
deferSaveComplete.reject(new DownloadError(aStatus, null,
|
let properties = { result: aStatus, inferCause: true };
|
||||||
true));
|
deferSaveComplete.reject(new DownloadError(properties));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1506,6 +1562,10 @@ DownloadCopySaver.prototype = {
|
||||||
onStartRequest: function (aRequest, aContext) {
|
onStartRequest: function (aRequest, aContext) {
|
||||||
backgroundFileSaver.onStartRequest(aRequest, aContext);
|
backgroundFileSaver.onStartRequest(aRequest, aContext);
|
||||||
|
|
||||||
|
if (this.isResponseParentalBlocked(aRequest)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
aSetPropertiesFn({ contentType: channel.contentType });
|
aSetPropertiesFn({ contentType: channel.contentType });
|
||||||
|
|
||||||
// Ensure we report the value of "Content-Length", if available,
|
// Ensure we report the value of "Content-Length", if available,
|
||||||
|
@ -1777,6 +1837,10 @@ DownloadLegacySaver.prototype = {
|
||||||
ex.result == Cr.NS_ERROR_NOT_RESUMABLE) { }
|
ex.result == Cr.NS_ERROR_NOT_RESUMABLE) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isResponseParentalBlocked(aRequest)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// For legacy downloads, we must update the referrer at this time.
|
// For legacy downloads, we must update the referrer at this time.
|
||||||
if (aRequest instanceof Ci.nsIHttpChannel && aRequest.referrer) {
|
if (aRequest instanceof Ci.nsIHttpChannel && aRequest.referrer) {
|
||||||
this.download.source.referrer = aRequest.referrer.spec;
|
this.download.source.referrer = aRequest.referrer.spec;
|
||||||
|
@ -1805,7 +1869,8 @@ DownloadLegacySaver.prototype = {
|
||||||
} else {
|
} else {
|
||||||
// Infer the origin of the error from the failure code, because more
|
// Infer the origin of the error from the failure code, because more
|
||||||
// specific data is not available through the nsITransfer implementation.
|
// specific data is not available through the nsITransfer implementation.
|
||||||
this.deferExecuted.reject(new DownloadError(aStatus, null, true));
|
let properties = { result: aStatus, inferCause: true };
|
||||||
|
this.deferExecuted.reject(new DownloadError(properties));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1355,6 +1355,7 @@ add_task(function test_blocked_parental_controls()
|
||||||
do_throw("The download should have blocked.");
|
do_throw("The download should have blocked.");
|
||||||
} catch (ex if ex instanceof Downloads.Error && ex.becauseBlocked) {
|
} catch (ex if ex instanceof Downloads.Error && ex.becauseBlocked) {
|
||||||
do_check_true(ex.becauseBlockedByParentalControls);
|
do_check_true(ex.becauseBlockedByParentalControls);
|
||||||
|
do_check_true(download.error.becauseBlockedByParentalControls);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that the download stopped, the target file should not exist.
|
// Now that the download stopped, the target file should not exist.
|
||||||
|
@ -1363,6 +1364,32 @@ add_task(function test_blocked_parental_controls()
|
||||||
cleanup();
|
cleanup();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test a download that will be blocked by Windows parental controls by
|
||||||
|
* resulting in an HTTP status code of 450.
|
||||||
|
*/
|
||||||
|
add_task(function test_blocked_parental_controls_httpstatus450()
|
||||||
|
{
|
||||||
|
let download;
|
||||||
|
try {
|
||||||
|
if (!gUseLegacySaver) {
|
||||||
|
download = yield promiseNewDownload(httpUrl("parentalblocked.zip"));
|
||||||
|
yield download.start();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
download = yield promiseStartLegacyDownload(httpUrl("parentalblocked.zip"));
|
||||||
|
yield promiseDownloadStopped(download);
|
||||||
|
}
|
||||||
|
do_throw("The download should have blocked.");
|
||||||
|
} catch (ex if ex instanceof Downloads.Error && ex.becauseBlocked) {
|
||||||
|
do_check_true(ex.becauseBlockedByParentalControls);
|
||||||
|
do_check_true(download.error.becauseBlockedByParentalControls);
|
||||||
|
do_check_true(download.stopped);
|
||||||
|
}
|
||||||
|
|
||||||
|
do_check_false(yield OS.File.exists(download.target.path));
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* download.showContainingDirectory() action
|
* download.showContainingDirectory() action
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -773,6 +773,13 @@ add_task(function test_common_initialize()
|
||||||
TEST_DATA_SHORT_GZIP_ENCODED_SECOND.length);
|
TEST_DATA_SHORT_GZIP_ENCODED_SECOND.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This URL will emulate being blocked by Windows Parental controls
|
||||||
|
gHttpServer.registerPathHandler("/parentalblocked.zip",
|
||||||
|
function (aRequest, aResponse) {
|
||||||
|
aResponse.setStatusLine(aRequest.httpVersion, 450,
|
||||||
|
"Blocked by Windows Parental Controls");
|
||||||
|
});
|
||||||
|
|
||||||
// Disable integration with the host application requiring profile access.
|
// Disable integration with the host application requiring profile access.
|
||||||
DownloadIntegration.dontLoadList = true;
|
DownloadIntegration.dontLoadList = true;
|
||||||
DownloadIntegration.dontLoadObservers = true;
|
DownloadIntegration.dontLoadObservers = true;
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "DownloadError",
|
||||||
|
"resource://gre/modules/DownloadCore.jsm");
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//// Execution of common tests
|
//// Execution of common tests
|
||||||
|
|
||||||
|
@ -17,6 +20,74 @@ let gUseLegacySaver = false;
|
||||||
let scriptFile = do_get_file("common_test_Download.js");
|
let scriptFile = do_get_file("common_test_Download.js");
|
||||||
Services.scriptloader.loadSubScript(NetUtil.newURI(scriptFile).spec);
|
Services.scriptloader.loadSubScript(NetUtil.newURI(scriptFile).spec);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//// Tests
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the DownloadError object.
|
||||||
|
*/
|
||||||
|
add_task(function test_DownloadError()
|
||||||
|
{
|
||||||
|
let error = new DownloadError({ result: Cr.NS_ERROR_NOT_RESUMABLE,
|
||||||
|
message: "Not resumable."});
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_NOT_RESUMABLE);
|
||||||
|
do_check_eq(error.message, "Not resumable.");
|
||||||
|
do_check_false(error.becauseSourceFailed);
|
||||||
|
do_check_false(error.becauseTargetFailed);
|
||||||
|
do_check_false(error.becauseBlocked);
|
||||||
|
do_check_false(error.becauseBlockedByParentalControls);
|
||||||
|
|
||||||
|
error = new DownloadError({ message: "Unknown error."});
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_FAILURE);
|
||||||
|
do_check_eq(error.message, "Unknown error.");
|
||||||
|
|
||||||
|
error = new DownloadError({ result: Cr.NS_ERROR_NOT_RESUMABLE });
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_NOT_RESUMABLE);
|
||||||
|
do_check_true(error.message.indexOf("Exception") > 0);
|
||||||
|
|
||||||
|
// becauseSourceFailed will be set, but not the unknown property.
|
||||||
|
error = new DownloadError({ message: "Unknown error.",
|
||||||
|
becauseSourceFailed: true,
|
||||||
|
becauseUnknown: true });
|
||||||
|
do_check_true(error.becauseSourceFailed);
|
||||||
|
do_check_false("becauseUnknown" in error);
|
||||||
|
|
||||||
|
error = new DownloadError({ result: Cr.NS_ERROR_MALFORMED_URI,
|
||||||
|
inferCause: true });
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_MALFORMED_URI);
|
||||||
|
do_check_true(error.becauseSourceFailed);
|
||||||
|
do_check_false(error.becauseTargetFailed);
|
||||||
|
do_check_false(error.becauseBlocked);
|
||||||
|
do_check_false(error.becauseBlockedByParentalControls);
|
||||||
|
|
||||||
|
// This test does not set inferCause, so becauseSourceFailed will not be set.
|
||||||
|
error = new DownloadError({ result: Cr.NS_ERROR_MALFORMED_URI });
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_MALFORMED_URI);
|
||||||
|
do_check_false(error.becauseSourceFailed);
|
||||||
|
|
||||||
|
error = new DownloadError({ result: Cr.NS_ERROR_FILE_INVALID_PATH,
|
||||||
|
inferCause: true });
|
||||||
|
do_check_eq(error.result, Cr.NS_ERROR_FILE_INVALID_PATH);
|
||||||
|
do_check_false(error.becauseSourceFailed);
|
||||||
|
do_check_true(error.becauseTargetFailed);
|
||||||
|
do_check_false(error.becauseBlocked);
|
||||||
|
do_check_false(error.becauseBlockedByParentalControls);
|
||||||
|
|
||||||
|
error = new DownloadError({ becauseBlocked: true });
|
||||||
|
do_check_eq(error.message, "Download blocked.");
|
||||||
|
do_check_false(error.becauseSourceFailed);
|
||||||
|
do_check_false(error.becauseTargetFailed);
|
||||||
|
do_check_true(error.becauseBlocked);
|
||||||
|
do_check_false(error.becauseBlockedByParentalControls);
|
||||||
|
|
||||||
|
error = new DownloadError({ becauseBlockedByParentalControls: true });
|
||||||
|
do_check_eq(error.message, "Download blocked.");
|
||||||
|
do_check_false(error.becauseSourceFailed);
|
||||||
|
do_check_false(error.becauseTargetFailed);
|
||||||
|
do_check_true(error.becauseBlocked);
|
||||||
|
do_check_true(error.becauseBlockedByParentalControls);
|
||||||
|
});
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//// Termination
|
//// Termination
|
||||||
|
|
||||||
|
|
|
@ -934,7 +934,6 @@ var WalkerActor = protocol.ActorClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
this._installHelperSheet(node);
|
this._installHelperSheet(node);
|
||||||
this.layoutHelpers.scrollIntoViewIfNeeded(node.rawNode);
|
|
||||||
DOMUtils.addPseudoClassLock(node.rawNode, HIGHLIGHTED_PSEUDO_CLASS);
|
DOMUtils.addPseudoClassLock(node.rawNode, HIGHLIGHTED_PSEUDO_CLASS);
|
||||||
this._highlightTimeout = setTimeout(this._unhighlight.bind(this), HIGHLIGHTED_TIMEOUT);
|
this._highlightTimeout = setTimeout(this._unhighlight.bind(this), HIGHLIGHTED_TIMEOUT);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ toolbarspacer {
|
||||||
/* ::::: toolbarpaletteitem ::::: */
|
/* ::::: toolbarpaletteitem ::::: */
|
||||||
|
|
||||||
toolbarpaletteitem {
|
toolbarpaletteitem {
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbarpaletteitem-box[type="spacer"],
|
.toolbarpaletteitem-box[type="spacer"],
|
||||||
|
|
|
@ -74,7 +74,7 @@ toolbarspacer {
|
||||||
/* ::::: toolbarpaletteitem ::::: */
|
/* ::::: toolbarpaletteitem ::::: */
|
||||||
|
|
||||||
toolbarpaletteitem {
|
toolbarpaletteitem {
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbarpaletteitem-box[type="spacer"],
|
.toolbarpaletteitem-box[type="spacer"],
|
||||||
|
|
|
@ -41,7 +41,7 @@ toolbarseparator {
|
||||||
/* ::::: toolbarpaletteitem ::::: */
|
/* ::::: toolbarpaletteitem ::::: */
|
||||||
|
|
||||||
toolbarpaletteitem {
|
toolbarpaletteitem {
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbar[iconsize="small"] toolbarpaletteitem[type="spacer"] {
|
toolbar[iconsize="small"] toolbarpaletteitem[type="spacer"] {
|
||||||
|
|
|
@ -65,7 +65,7 @@ toolbarspacer {
|
||||||
/* ::::: toolbarpaletteitem ::::: */
|
/* ::::: toolbarpaletteitem ::::: */
|
||||||
|
|
||||||
toolbarpaletteitem {
|
toolbarpaletteitem {
|
||||||
cursor: -moz-grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbarpaletteitem-box[type="spacer"],
|
.toolbarpaletteitem-box[type="spacer"],
|
||||||
|
|
Загрузка…
Ссылка в новой задаче