Skip to content

Commit

Permalink
Merge mozilla-central to inbound. a=merge CLOSED TREE
Browse files Browse the repository at this point in the history
  • Loading branch information
shindli committed Feb 13, 2019
2 parents aae4025 + 395b694 commit 54aa04b
Show file tree
Hide file tree
Showing 332 changed files with 6,735 additions and 3,576 deletions.
4 changes: 2 additions & 2 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ xpcom/reflect/xptcall/md/unix/.*
browser/components/translation/cld2/.*
browser/extensions/mortar/ppapi/.*
db/sqlite3/src/.*
devtools/client/sourceeditor/codemirror/.*
devtools/client/sourceeditor/tern/.*
devtools/client/shared/sourceeditor/codemirror/.*
devtools/client/shared/sourceeditor/tern/.*
dom/canvas/test/webgl-conf/checkout/closure-library/.*
dom/media/gmp/rlz/.*
dom/media/gmp/widevine-adapter/content_decryption_module.h
Expand Down
10 changes: 5 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ devtools/client/jsonview/lib/require.js
devtools/client/shared/demangle.js
devtools/client/shared/source-map/*
devtools/client/shared/vendor/*
devtools/client/sourceeditor/codemirror/*.js
devtools/client/sourceeditor/codemirror/**/*.js
devtools/client/sourceeditor/tern/*
devtools/client/sourceeditor/test/cm_mode_ruby.js
devtools/client/sourceeditor/test/codemirror/*
devtools/client/shared/sourceeditor/codemirror/*.js
devtools/client/shared/sourceeditor/codemirror/**/*.js
devtools/client/shared/sourceeditor/tern/*
devtools/client/shared/sourceeditor/test/cm_mode_ruby.js
devtools/client/shared/sourceeditor/test/codemirror/*
devtools/server/actors/utils/automation-timeline.js

# Ignore devtools files testing sourcemaps / code style
Expand Down
2 changes: 0 additions & 2 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ pref("browser.startup.homepage", "about:home");
// Whether we should skip the homepage when opening the first-run page
pref("browser.startup.firstrunSkipsHomepage", true);

pref("browser.dedicatedprofile.welcome.accounts.endpoint", "https://accounts.firefox.com/");

// Show an about:blank window as early as possible for quick startup feedback.
// Held to nightly on Linux due to bug 1450626.
// Disabled on Mac because the bouncing dock icon already provides feedback.
Expand Down
14 changes: 8 additions & 6 deletions browser/base/content/newInstallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* 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/. */

/* global RPMGetUpdateChannel, RPMGetFxAccountsEndpoint */

const PARAMS = new URL(location).searchParams;
const ENTRYPOINT = "new-install-page";
const SOURCE = `new-install-page-${PARAMS.get("channel")}`;
const SOURCE = `new-install-page-${RPMGetUpdateChannel()}`;
const CAMPAIGN = "dedicated-profiles";
const ENDPOINT = PARAMS.get("endpoint");
const CONTEXT = "fx_desktop_v3";

function appendAccountsParams(url) {
url.searchParams.set("entrypoint", ENTRYPOINT);
Expand All @@ -24,7 +25,8 @@ function appendParams(url, params) {
}

async function requestFlowMetrics() {
let requestURL = new URL(`${ENDPOINT}metrics-flow`);
let requestURL = new URL(await endpoint);
requestURL.pathname = "metrics-flow";
appendParams(requestURL, {
"form_type": "email",
});
Expand All @@ -47,11 +49,9 @@ async function submitForm(event) {

let { flowId, flowBeginTime } = await metrics;

let requestURL = new URL(ENDPOINT);
let requestURL = new URL(await endpoint);
appendParams(requestURL, {
"service": "sync",
"action": "email",
"context": CONTEXT,
"utm_campaign": CAMPAIGN,
"email": input.value,
"flow_id": flowId,
Expand All @@ -61,6 +61,8 @@ async function submitForm(event) {
window.open(requestURL, "_blank", "noopener");
}

const endpoint = RPMGetFxAccountsEndpoint(ENTRYPOINT);

// This must come before the CSP is set or it will be blocked.
const metrics = requestFlowMetrics();

Expand Down
15 changes: 10 additions & 5 deletions browser/components/nsBrowserContentHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
ShellService: "resource:///modules/ShellService.jsm",
UpdatePing: "resource://gre/modules/UpdatePing.jsm",
RemotePages: "resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm",
});
XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils",
"@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
Expand All @@ -23,6 +24,8 @@ XPCOMUtils.defineLazyGetter(this, "gSystemPrincipal",
() => Services.scriptSecurityManager.getSystemPrincipal());
XPCOMUtils.defineLazyGlobalGetters(this, [URL]);

const NEWINSTALL_PAGE = "about:newinstall";

function shouldLoadURI(aURI) {
if (aURI && !aURI.schemeIs("chrome"))
return true;
Expand Down Expand Up @@ -60,12 +63,14 @@ function resolveURIInternal(aCmdLine, aArgument) {
return uri;
}

let gRemoteInstallPage = null;

function getNewInstallPage() {
let url = new URL("about:newinstall");
let endpoint = Services.prefs.getCharPref("browser.dedicatedprofile.welcome.accounts.endpoint");
url.searchParams.set("endpoint", endpoint);
url.searchParams.set("channel", AppConstants.MOZ_UPDATE_CHANNEL);
return url.toString();
if (!gRemoteInstallPage) {
gRemoteInstallPage = new RemotePages(NEWINSTALL_PAGE);
}

return NEWINSTALL_PAGE;
}

var gFirstWindow = false;
Expand Down
6 changes: 3 additions & 3 deletions browser/components/preferences/connection.xul
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@
</radiogroup>
</box>
</row>
<label data-l10n-id="connection-proxy-noproxy" control="networkProxyNone"/>
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
<label control="networkProxyNone" data-l10n-id="connection-proxy-noproxy-desc" />
</rows>
</grid>
<radio value="2" data-l10n-id="connection-proxy-autotype" />
Expand All @@ -142,6 +139,9 @@
</radiogroup>
</groupbox>
<separator class="thin"/>
<label data-l10n-id="connection-proxy-noproxy" control="networkProxyNone"/>
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
<label control="networkProxyNone" data-l10n-id="connection-proxy-noproxy-desc" />
<checkbox id="autologinProxy"
data-l10n-id="connection-proxy-autologin"
preference="signon.autologin.proxy" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ add_task(async function testExtensionControlledProxyConfig() {
...doc.querySelectorAll("#networkProxySOCKSVersion > radio")],
pacControls: [doc.getElementById("networkProxyAutoconfigURL")],
otherControls: [
manualControlContainer.querySelector("label[control=networkProxyNone]"),
doc.querySelector("label[control=networkProxyNone]"),
doc.getElementById("networkProxyNone"),
...controlGroup.querySelectorAll(":scope > radio"),
...doc.querySelectorAll("#ConnectionsDialogPane > checkbox")],
Expand Down
24 changes: 16 additions & 8 deletions browser/components/search/content/search-one-offs.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class SearchOneOffs {
// If the button doesn't have an engine, then clear the popup's
// selection to indicate that pressing Return while the button is
// selected will do the button's command, not search.
this.popup.selectedIndex = -1;
this.selectedAutocompleteIndex = -1;
}
let event = new CustomEvent("SelectedOneOffButtonChanged", {
previousSelectedButton: previousButton,
Expand Down Expand Up @@ -334,6 +334,14 @@ class SearchOneOffs {
return -1;
}

get selectedAutocompleteIndex() {
return (this._view || this.popup).selectedIndex;
}

set selectedAutocompleteIndex(val) {
return (this._view || this.popup).selectedIndex = val;
}

get compact() {
return this.getAttribute("compact") == "true";
}
Expand Down Expand Up @@ -887,7 +895,7 @@ class SearchOneOffs {
this.selectedButton = null;
return false;
}
this.popup.selectedIndex = -1;
this.selectedAutocompleteIndex = -1;
this.advanceSelection(!event.shiftKey, true, false);
return !!this.selectedButton;
}
Expand All @@ -904,13 +912,13 @@ class SearchOneOffs {
this.advanceSelection(false, true, false);
return true;
}
if (this.popup.selectedIndex > 0) {
if (this.selectedAutocompleteIndex > 0) {
// Moving up within the list. The autocomplete controller should
// handle this case. A button may be selected, so null it.
this.selectedButton = null;
return false;
}
if (this.popup.selectedIndex == 0) {
if (this.selectedAutocompleteIndex == 0) {
// Moving up from the top of the list.
if (allowEmptySelection) {
// Let the autocomplete controller remove selection in the list
Expand Down Expand Up @@ -952,14 +960,14 @@ class SearchOneOffs {
this.advanceSelection(true, true, false);
return true;
}
if (this.popup.selectedIndex >= 0 &&
this.popup.selectedIndex < numListItems - 1) {
if (this.selectedAutocompleteIndex >= 0 &&
this.selectedAutocompleteIndex < numListItems - 1) {
// Moving down within the list. The autocomplete controller
// should handle this case. A button may be selected, so null it.
this.selectedButton = null;
return false;
}
if (this.popup.selectedIndex == numListItems - 1) {
if (this.selectedAutocompleteIndex == numListItems - 1) {
// Moving down from the last item in the list to the buttons.
this.selectedButtonIndex = 0;
if (allowEmptySelection) {
Expand All @@ -970,7 +978,7 @@ class SearchOneOffs {
if (this.textbox && typeof textboxUserValue == "string") {
this.textbox.value = textboxUserValue;
}
this.popup.selectedIndex = -1;
this.selectedAutocompleteIndex = -1;
return true;
}
if (this.selectedButton) {
Expand Down
14 changes: 14 additions & 0 deletions browser/components/urlbar/UrlbarController.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ class UrlbarController {
return;
}

if (this.view.isOpen) {
let queryContext = this._lastQueryContext;
if (queryContext) {
this.view.oneOffSearchButtons.handleKeyPress(
event,
queryContext.results.length,
this.view.allowEmptySelection,
queryContext.searchString);
if (event.defaultPrevented) {
return;
}
}
}

switch (event.keyCode) {
case KeyEvent.DOM_VK_ESCAPE:
this.input.handleRevert();
Expand Down
12 changes: 8 additions & 4 deletions browser/components/urlbar/UrlbarView.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class UrlbarView {
return this.panel.state == "open" || this.panel.state == "showing";
}

get allowEmptySelection() {
return !(this._queryContext &&
this._queryContext.results[0] &&
this._queryContext.results[0].heuristic);
}

get selectedIndex() {
if (!this.isOpen || !this._selected) {
return -1;
Expand Down Expand Up @@ -115,15 +121,13 @@ class UrlbarView {
throw new Error("UrlbarView: Cannot select an item if the view isn't open.");
}

// TODO bug 1527260: handle one-off search buttons

let row;
if (reverse) {
row = (this._selected && this._selected.previousElementSibling) ||
this._rows.lastElementChild;
((this._selected && this.allowEmptySelection) ? null : this._rows.lastElementChild);
} else {
row = (this._selected && this._selected.nextElementSibling) ||
this._rows.firstElementChild;
((this._selected && this.allowEmptySelection) ? null : this._rows.firstElementChild);
}
this._selectItem(row);
}
Expand Down
2 changes: 1 addition & 1 deletion browser/locales/en-US/browser/preferences/connection.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ connection-proxy-socks4 =
connection-proxy-socks5 =
.label = SOCKS v5
.accesskey = v
connection-proxy-noproxy = No Proxy for
connection-proxy-noproxy = No proxy for
.accesskey = N
connection-proxy-noproxy-desc = Example: .mozilla.org, .net.nz, 192.168.1.0/24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const InspectAction = createFactory(require("./InspectAction"));

const Actions = require("../../actions/index");
const Types = require("../../types/index");
const { SERVICE_WORKER_STATUSES } = require("../../constants");

/**
* This component displays buttons for service worker.
Expand Down Expand Up @@ -105,25 +106,29 @@ class ServiceWorkerAction extends PureComponent {
}

_renderAction() {
const { isActive, isRunning } = this.props.target.details;

if (!isRunning) {
return [
this._renderUnregisterButton(),
this._renderStartButton(),
];
}

if (!isActive) {
// Only inspect is available if the service worker is not active.
return [this._renderInspectAction()];
const { status } = this.props.target.details;

switch (status) {
case SERVICE_WORKER_STATUSES.RUNNING:
return [
this._renderUnregisterButton(),
this._renderPushButton(),
this._renderInspectAction(),
];
case SERVICE_WORKER_STATUSES.REGISTERING:
// Only inspect is available if the service worker is not active.
return [
this._renderInspectAction(),
];
case SERVICE_WORKER_STATUSES.STOPPED:
return [
this._renderUnregisterButton(),
this._renderStartButton(),
];
default:
console.error("Unexpected service worker status: " + status);
return [];
}

return [
this._renderUnregisterButton(),
this._renderPushButton(),
this._renderInspectAction(),
];
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const workerComponentDataMiddleware = store => next => action => {
return next(action);
};

function getServiceWorkerStatus(isActive, isRunning) {
function getServiceWorkerStatus(worker) {
const isActive = worker.active;
const isRunning = !!worker.workerTargetFront;

if (isActive && isRunning) {
return SERVICE_WORKER_STATUSES.RUNNING;
} else if (isActive) {
Expand Down Expand Up @@ -59,25 +62,19 @@ function toComponentData(workers, isServiceWorker) {
// service worker registration.
const id = workerTargetFront ? workerTargetFront.actorID : registrationFront.actorID;

let isActive = false;
let isRunning = false;
let pushServiceEndpoint = null;
let status = null;

if (isServiceWorker) {
fetch = fetch ? SERVICE_WORKER_FETCH_STATES.LISTENING
: SERVICE_WORKER_FETCH_STATES.NOT_LISTENING;
isActive = worker.active;
isRunning = !!worker.workerTargetFront;
status = getServiceWorkerStatus(isActive, isRunning);
status = getServiceWorkerStatus(worker);
pushServiceEndpoint = subscription ? subscription.endpoint : null;
}

return {
details: {
fetch,
isActive,
isRunning,
pushServiceEndpoint,
registrationFront,
scope,
Expand Down
4 changes: 0 additions & 4 deletions devtools/client/aboutdebugging-new/src/types/debug-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ const tabTargetDetails = {
const workerTargetDetails = {
// (service worker specific) one of "LISTENING", "NOT_LISTENING". undefined otherwise.
fetch: PropTypes.string,
// (service worker specific) true if they reached the activated state.
isActive: PropTypes.bool,
// (service worker specific) true if they are currently running.
isRunning: PropTypes.bool,
// front for the ServiceWorkerRegistration related to this service worker.
registrationFront: PropTypes.object,
// (service worker specific) scope of the service worker registration.
Expand Down
Loading

0 comments on commit 54aa04b

Please sign in to comment.