If PushService has not been created when getInstance is called, create
the PushService instead of throwing an error. This fixes a possible race
condition between initializing PushService and receiving a push message,
where we can receive a push message first.
As of the writing of this patch, NSSDialogService pops up a prompter on
Android as follows (assuming at least one label is requested):
1. NSSDialogService.js calls Prompt.jsm methods and eventually requests the
prompt be displayed.
2. Prompt.jsm sends a messages to the Java side.
3. The Java side receives the message and eventually calls
org.mozilla.gecko.prompts.PromptInput.LabelInput.getView().
4. LabelInput.getView() calls android.text.Html.fromHtml().
At no point is any HTML injection prevention done, so in theory NSSDialogService
could be an injection vector.
In practice, it appears that fromHtml() doesn't actually allow anything malicious
to be done. This patch introduces HTML escaping at the NSSDialogService
level just to be safe.
MozReview-Commit-ID: LhHuZKSqx01
--HG--
extra : transplant_source : l%C9%A2%95%9A.%05%1F%CF%5D%02%5E%12N%C1%B7O%7C%1B%8B
By changing the Interpolator to be linear instead of decelerating, we should
see an animation with constant speed. I've also reduced the animation time
from 250 milliseconds to 150 to give it a snappier feel.
MozReview-Commit-ID: LBsdxG0lyvX
--HG--
extra : rebase_source : ef2f1fb0d9e18ce4f23932355e40888355411b36
extra : amend_source : f9f1a0763ac785c4e115a5be78fddb7a83000270
When launching fennec while device is offline, we would often not send these events to Gecko,
and it wouldn't know to load tabs from cache. sendEventToGecko would queue up our events for us if GeckoThread isn't
in the RUNNING state, so let's rely on that mechanism instead. It's possible that we will have a succession of network
state events which aren't valid by the time they're actually sent, but as long as event queue is FIFO, it should be ok.
MozReview-Commit-ID: BCiO2EozUnx
--HG--
extra : rebase_source : 3935444f69be9171aa60a8f4b3e5db29035ecb6c
registerReceiver returns the first sticky intent which matches our filter, or null
if there aren't any. Remove the log statement about "failed registration", since null just
means that we haven't had any sticky broadcasts for this filter yet.
MozReview-Commit-ID: KA2Rxt2fk2T
--HG--
extra : rebase_source : 37adcb2a240f36466a95bc34c904dece422e9bbd
By default, i.e. for most lists in the homepanels, we want to open the offline reader-view version
of a page if the page is stored as an offline reader-view bookmark (TwoLinePageRow shows the bookmark
and offline status for pages, not only in bookmarks, but also in the list of top sites, awesomescreen
results, and history). The only exception is the topsites grid, where we don't offer any indication
of the bookmark or offline status of a page. For now the expectation is that topsites open the
normal version of a page, so we need to bypass the usual flow for that case.
(It's possible the UI around this would change in future, but with the current UI this is probably
the most obvious / least frustrating behaviour.)
MozReview-Commit-ID: BMpGG4KQ62w
--HG--
extra : rebase_source : a223304451e46e1c0429c5b3bcd9be6d43bf9428
extra : amend_source : 462ea5b54781fd8c534a4a4a484fd60714e3f40d
For now, this event is only going to be used to cover a narrow edge case around
display of the "Showing offline version" snackbar, so let's not overthink it.
MozReview-Commit-ID: Cd9q7kwnjjQ
--HG--
extra : rebase_source : ebf8656565fef1b6969fb89de20fdd62a64e5043
This issue has been fixed in the latest Android N preview, we should
remove the workaround to simplify the code.
MozReview-Commit-ID: 6xwIA5QzzhQ
--HG--
extra : rebase_source : dc84f80591ffe2fe779c1649f15376cc29d32662
- Use Content:PageShow event to inform Tabs that they were actively loaded from cache
- Move offline notification logic away from browser.js and into a delegate, which displays notifications when
tab in question is user-visible
MozReview-Commit-ID: 2qCACHyWOlp
--HG--
extra : rebase_source : 457a42ebba5cfc32ab7dabce0a8a11d6511b9c08
This provides implementations of ChooseCertificate() with more flexibility, and
allows callers of ChooseCertificate() to be less complex.
A portion of this work involves reimplementing
nsNSSCertificate::FormatUIStrings() in JS and improving UI strings for l10n.
MozReview-Commit-ID: CE7Uc2ntwmZ
--HG--
extra : transplant_source : R%A8eC%CEO2%DC%20%F7%B4V%F3g%E6h%EB%D5%8D3
This fixes the following in the IDL:
1. Misleading or unclear parameter names in the IDL. |cn| in practice is the
concatenation of the CN of the server cert and the port of the server, and
|issuer| is the Organization of the issuer cert of the server cert.
2. Use of the |wstring| type. |AString| is generally preferred, and has the
benefit of letting implementations skip null checks due to the use of
references.
3. Using an explicit |canceled| outparam instead of just setting a return type.
There is no need for the outparam if the return type can be used.
4. Using |long| (int32_t) for |selectedIndex|. |unsigned long| (uint32_t) is
more logical, and paves the way for future changes.
This fixes the following in the Android implementation:
1. Lack of checks to ensure the QueryInterface() call succeeded. In practice,
the call will always succeed, but it's good practice to check anyways.
2. Setting a variable to an nsIPrefService instance initially, then later
setting it to a pref branch instance later on. This is confusing and
unnecessary.
This fixes the following in the desktop implementation:
1. Lack of null pointer checking.
2. Trying to get a parent window ref off a context that doesn't actually support
doing so.
3. Setting a variable to an nsIPrefService instance initially, then later
setting it to a pref branch instance later on. This is confusing and
unnecessary.
4. Abusal of the CAPS bundle.
5. Unnecessary variables.
6. Variables declared far away from where they are used.
7. Variable shadowing.
8. Style issues.
9. Lack of documentation.
This also fixes the following:
1. Lack of localisation notes.
MozReview-Commit-ID: FTc6XecJd6h
--HG--
extra : transplant_source : %ABQ%8F%E6%A3%25%FE%94%E4%D6X%3D%28%2C%05%5E%FB%84.-
This fixes two issues:
1. Passing a literal 1 as the |length| argument to formatStringFromName(). This
is obviously incorrect and should instead be the length of the given arg
list.
2. Directly setting the |selectedIndex| outparam to a number. XPIDL outparams
on the JS side are actually objects that wrap the true outparam value, which
must be accessed via |.value|.
MozReview-Commit-ID: BJObQfcV5G7
--HG--
extra : transplant_source : %11%B2TD%F5%C3%84%BD%C1%7B%3B%1Em%EC%CA%CAu%E5%3Dq