mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Merge m-c to inbound. a=merge
This commit is contained in:
commit
1be3c9d1e3
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="6ca2008ac50b163d31244ef9f036cb224f4f229b"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="6ca2008ac50b163d31244ef9f036cb224f4f229b"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "47459a0d67fae95c221568ef03c773b8cb5b92a7",
|
||||
"revision": "98070bfac72f0695a2c792debac079eb26f3929d",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="6ca2008ac50b163d31244ef9f036cb224f4f229b"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="717ad4e8b7fc10ab8248500d00ba5ba0977fa8ab"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3b81896f04a02697e615fa5390086bd5ecfed84f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cc1f362ce43dce92ac786187ff4abf39060094bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -3,6 +3,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Components.utils.import("resource:///modules/SitePermissions.jsm");
|
||||
Components.utils.import("resource://gre/modules/BrowserUtils.jsm");
|
||||
|
||||
const nsIQuotaManager = Components.interfaces.nsIQuotaManager;
|
||||
|
||||
@ -231,20 +232,6 @@ function onIndexedDBUsageCallback(uri, usage, fileUsage)
|
||||
}
|
||||
}
|
||||
|
||||
// XXX copied this from browser-plugins.js - is there a way to share?
|
||||
function makeNicePluginName(aName) {
|
||||
if (aName == "Shockwave Flash")
|
||||
return "Adobe Flash";
|
||||
|
||||
// Clean up the plugin name by stripping off any trailing version numbers
|
||||
// or "plugin". EG, "Foo Bar Plugin 1.23_02" --> "Foo Bar"
|
||||
// Do this by first stripping the numbers, etc. off the end, and then
|
||||
// removing "Plugin" (and then trimming to get rid of any whitespace).
|
||||
// (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
|
||||
let newName = aName.replace(/[\s\d\.\-\_\(\)]+$/, "").replace(/\bplug-?in\b/i, "").trim();
|
||||
return newName;
|
||||
}
|
||||
|
||||
function fillInPluginPermissionTemplate(aPluginName, aPermissionString) {
|
||||
let permPluginTemplate = document.getElementById("permPluginTemplate").cloneNode(true);
|
||||
permPluginTemplate.setAttribute("permString", aPermissionString);
|
||||
@ -288,7 +275,7 @@ function initPluginsRow() {
|
||||
for (let mimeType of plugin.getMimeTypes()) {
|
||||
let permString = pluginHost.getPermissionStringForType(mimeType);
|
||||
if (!permissionMap.has(permString)) {
|
||||
var name = makeNicePluginName(plugin.name);
|
||||
let name = BrowserUtils.makeNicePluginName(plugin.name);
|
||||
if (permString.startsWith("plugin-vulnerable:")) {
|
||||
name += " \u2014 " + vulnerableLabel;
|
||||
}
|
||||
|
@ -301,6 +301,7 @@ SearchSuggestionUIController.prototype = {
|
||||
|
||||
_makeTableRow: function (type, suggestionStr, currentRow, searchWords) {
|
||||
let row = document.createElementNS(HTML_NS, "tr");
|
||||
row.dir = "auto";
|
||||
row.classList.add("searchSuggestionRow");
|
||||
row.classList.add(type);
|
||||
row.setAttribute("role", "presentation");
|
||||
@ -365,7 +366,6 @@ SearchSuggestionUIController.prototype = {
|
||||
this._table = document.createElementNS(HTML_NS, "table");
|
||||
this._table.id = id;
|
||||
this._table.hidden = true;
|
||||
this._table.dir = "auto";
|
||||
this._table.classList.add("searchSuggestionTable");
|
||||
this._table.setAttribute("role", "listbox");
|
||||
return this._table;
|
||||
|
@ -43,6 +43,8 @@ add_task(function* () {
|
||||
|
||||
let result = yield promise_first_result("open a search");
|
||||
isnot(result, null, "Should have a result");
|
||||
is(result.hasAttribute("image"), false, "Result shouldn't have an image attribute");
|
||||
|
||||
let tabPromise = promiseTabLoaded(gBrowser.selectedTab);
|
||||
EventUtils.synthesizeMouseAtCenter(result, {});
|
||||
yield tabPromise;
|
||||
|
@ -3,14 +3,13 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
**/
|
||||
|
||||
let gOriginalEngine;
|
||||
let gOriginalEngine;
|
||||
|
||||
add_task(function* () {
|
||||
// This test is only relevant if UnifiedComplete is enabled.
|
||||
if (!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
|
||||
return;
|
||||
Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", true);
|
||||
|
||||
Services.search.addEngineWithDetails("MozSearch", "", "moz", "", "GET",
|
||||
let iconURI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC";
|
||||
Services.search.addEngineWithDetails("MozSearch", iconURI, "moz", "", "GET",
|
||||
"http://example.com/?q={searchTerms}");
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
gOriginalEngine = Services.search.currentEngine;
|
||||
@ -22,6 +21,7 @@ add_task(function* () {
|
||||
Services.search.currentEngine = gOriginalEngine;
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
Services.search.removeEngine(engine);
|
||||
Services.prefs.clearUserPref("browser.urlbar.unifiedcomplete");
|
||||
|
||||
try {
|
||||
gBrowser.removeTab(tab);
|
||||
@ -35,6 +35,12 @@ add_task(function* () {
|
||||
EventUtils.synthesizeKey("h" , {});
|
||||
yield promiseSearchComplete();
|
||||
|
||||
let result = gURLBar.popup.richlistbox.children[0];
|
||||
ok(result.hasAttribute("image"), "Result should have an image attribute");
|
||||
// Image attribute gets a suffix (-moz-resolution) added in the value.
|
||||
ok(result.getAttribute("image").startsWith(engine.iconURI.spec),
|
||||
"Image attribute should have the search engine's icon");
|
||||
|
||||
EventUtils.synthesizeKey("VK_RETURN" , { });
|
||||
yield promiseTabLoaded(gBrowser.selectedTab);
|
||||
|
||||
|
@ -24,7 +24,9 @@ function test() {
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
ok (!DevEdition.styleSheet, "There is no devedition style sheet by default.");
|
||||
info ("Setting browser.devedition.theme.enabled to false.");
|
||||
Services.prefs.setBoolPref(PREF_DEVEDITION_THEME, false);
|
||||
ok (!DevEdition.styleSheet, "There is no devedition style sheet when the pref is false.");
|
||||
|
||||
info ("Setting browser.devedition.theme.enabled to true.");
|
||||
Services.prefs.setBoolPref(PREF_DEVEDITION_THEME, true);
|
||||
@ -53,6 +55,7 @@ function startTests() {
|
||||
ok (!DevEdition.styleSheet, "The devedition stylesheet has been removed.");
|
||||
|
||||
info ("Checking :root attributes based on devtools theme.");
|
||||
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
|
||||
is (document.documentElement.getAttribute("devtoolstheme"), "light",
|
||||
"The documentElement has an attribute based on devtools theme.");
|
||||
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
|
||||
|
@ -20,7 +20,7 @@
|
||||
<script type="text/javascript" src="loop/libs/l10n.js"></script>
|
||||
<script type="text/javascript" src="loop/js/otconfig.js"></script>
|
||||
<script type="text/javascript" src="loop/libs/sdk.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/react-0.11.1.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/react-0.11.2.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/lodash-2.4.1.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<div id="main"></div>
|
||||
|
||||
<script type="text/javascript" src="loop/shared/libs/react-0.11.1.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/react-0.11.2.js"></script>
|
||||
<script type="text/javascript" src="loop/libs/l10n.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/lodash-2.4.1.js"></script>
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* React (with addons) v0.11.1
|
||||
* React (with addons) v0.11.2
|
||||
*/
|
||||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.React=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
/**
|
||||
@ -3713,6 +3713,7 @@ var HTMLDOMPropertyConfig = {
|
||||
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
||||
max: null,
|
||||
maxLength: MUST_USE_ATTRIBUTE,
|
||||
media: MUST_USE_ATTRIBUTE,
|
||||
mediaGroup: null,
|
||||
method: null,
|
||||
min: null,
|
||||
@ -3720,6 +3721,7 @@ var HTMLDOMPropertyConfig = {
|
||||
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
||||
name: null,
|
||||
noValidate: HAS_BOOLEAN_VALUE,
|
||||
open: null,
|
||||
pattern: null,
|
||||
placeholder: null,
|
||||
poster: null,
|
||||
@ -3740,11 +3742,12 @@ var HTMLDOMPropertyConfig = {
|
||||
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
||||
shape: null,
|
||||
size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
||||
sizes: MUST_USE_ATTRIBUTE,
|
||||
span: HAS_POSITIVE_NUMERIC_VALUE,
|
||||
spellCheck: null,
|
||||
src: null,
|
||||
srcDoc: MUST_USE_PROPERTY,
|
||||
srcSet: null,
|
||||
srcSet: MUST_USE_ATTRIBUTE,
|
||||
start: HAS_NUMERIC_VALUE,
|
||||
step: null,
|
||||
style: null,
|
||||
@ -4279,9 +4282,21 @@ var ReactServerRendering = _dereq_("./ReactServerRendering");
|
||||
var ReactTextComponent = _dereq_("./ReactTextComponent");
|
||||
|
||||
var onlyChild = _dereq_("./onlyChild");
|
||||
var warning = _dereq_("./warning");
|
||||
|
||||
ReactDefaultInjection.inject();
|
||||
|
||||
// Specifying arguments isn't necessary since we just use apply anyway, but it
|
||||
// makes it clear for those actually consuming this API.
|
||||
function createDescriptor(type, props, children) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return type.apply(null, args);
|
||||
}
|
||||
|
||||
if ("production" !== "development") {
|
||||
var _warnedForDeprecation = false;
|
||||
}
|
||||
|
||||
var React = {
|
||||
Children: {
|
||||
map: ReactChildren.map,
|
||||
@ -4295,10 +4310,18 @@ var React = {
|
||||
EventPluginUtils.useTouchEvents = shouldUseTouch;
|
||||
},
|
||||
createClass: ReactCompositeComponent.createClass,
|
||||
createDescriptor: function(type, props, children) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return type.apply(null, args);
|
||||
createDescriptor: function() {
|
||||
if ("production" !== "development") {
|
||||
("production" !== "development" ? warning(
|
||||
_warnedForDeprecation,
|
||||
'React.createDescriptor is deprecated and will be removed in the ' +
|
||||
'next version of React. Use React.createElement instead.'
|
||||
) : null);
|
||||
_warnedForDeprecation = true;
|
||||
}
|
||||
return createDescriptor.apply(this, arguments);
|
||||
},
|
||||
createElement: createDescriptor,
|
||||
constructAndRenderComponent: ReactMount.constructAndRenderComponent,
|
||||
constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
|
||||
renderComponent: ReactPerf.measure(
|
||||
@ -4367,11 +4390,11 @@ if ("production" !== "development") {
|
||||
|
||||
// Version exists only in the open-source version of React, not in Facebook's
|
||||
// internal version.
|
||||
React.version = '0.11.1';
|
||||
React.version = '0.11.2';
|
||||
|
||||
module.exports = React;
|
||||
|
||||
},{"./DOMPropertyOperations":12,"./EventPluginUtils":20,"./ExecutionEnvironment":22,"./ReactChildren":34,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDOM":41,"./ReactDOMComponent":43,"./ReactDefaultInjection":53,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./ReactPropTypes":75,"./ReactServerRendering":79,"./ReactTextComponent":83,"./onlyChild":149}],30:[function(_dereq_,module,exports){
|
||||
},{"./DOMPropertyOperations":12,"./EventPluginUtils":20,"./ExecutionEnvironment":22,"./ReactChildren":34,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDOM":41,"./ReactDOMComponent":43,"./ReactDefaultInjection":53,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./ReactPropTypes":75,"./ReactServerRendering":79,"./ReactTextComponent":83,"./onlyChild":149,"./warning":158}],30:[function(_dereq_,module,exports){
|
||||
/**
|
||||
* Copyright 2013-2014 Facebook, Inc.
|
||||
*
|
||||
@ -7408,6 +7431,7 @@ var ReactDOM = mapObject({
|
||||
del: false,
|
||||
details: false,
|
||||
dfn: false,
|
||||
dialog: false,
|
||||
div: false,
|
||||
dl: false,
|
||||
dt: false,
|
||||
@ -7455,6 +7479,7 @@ var ReactDOM = mapObject({
|
||||
output: false,
|
||||
p: false,
|
||||
param: true,
|
||||
picture: false,
|
||||
pre: false,
|
||||
progress: false,
|
||||
q: false,
|
@ -69,9 +69,9 @@ browser.jar:
|
||||
|
||||
# Shared libs
|
||||
#ifdef DEBUG
|
||||
content/browser/loop/shared/libs/react-0.11.1.js (content/shared/libs/react-0.11.1.js)
|
||||
content/browser/loop/shared/libs/react-0.11.2.js (content/shared/libs/react-0.11.2.js)
|
||||
#else
|
||||
content/browser/loop/shared/libs/react-0.11.1.js (content/shared/libs/react-0.11.1-prod.js)
|
||||
content/browser/loop/shared/libs/react-0.11.2.js (content/shared/libs/react-0.11.2-prod.js)
|
||||
#endif
|
||||
content/browser/loop/shared/libs/lodash-2.4.1.js (content/shared/libs/lodash-2.4.1.js)
|
||||
content/browser/loop/shared/libs/jquery-2.1.0.js (content/shared/libs/jquery-2.1.0.js)
|
||||
|
@ -29,7 +29,7 @@
|
||||
</script>
|
||||
<script type="text/javascript" src="shared/libs/sdk.js"></script>
|
||||
<script type="text/javascript" src="libs/l10n-gaia-02ca67948fe8.js"></script>
|
||||
<script type="text/javascript" src="shared/libs/react-0.11.1.js"></script>
|
||||
<script type="text/javascript" src="shared/libs/react-0.11.2.js"></script>
|
||||
<script type="text/javascript" src="shared/libs/jquery-2.1.0.js"></script>
|
||||
<script type="text/javascript" src="shared/libs/lodash-2.4.1.js"></script>
|
||||
<script type="text/javascript" src="shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div id="fixtures"></div>
|
||||
<!-- libs -->
|
||||
<script src="../../content/libs/l10n.js"></script>
|
||||
<script src="../../content/shared/libs/react-0.11.1.js"></script>
|
||||
<script src="../../content/shared/libs/react-0.11.2.js"></script>
|
||||
<script src="../../content/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script src="../../content/shared/libs/lodash-2.4.1.js"></script>
|
||||
<script src="../../content/shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div id="fixtures"></div>
|
||||
|
||||
<!-- libs -->
|
||||
<script src="../../content/shared/libs/react-0.11.1.js"></script>
|
||||
<script src="../../content/shared/libs/react-0.11.2.js"></script>
|
||||
<script src="../../content/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script src="../../content/shared/libs/lodash-2.4.1.js"></script>
|
||||
<script src="../../content/shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div id="messages"></div>
|
||||
<div id="fixtures"></div>
|
||||
<!-- libs -->
|
||||
<script src="../../content/shared/libs/react-0.11.1.js"></script>
|
||||
<script src="../../content/shared/libs/react-0.11.2.js"></script>
|
||||
<script src="../../content/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script src="../../content/shared/libs/lodash-2.4.1.js"></script>
|
||||
<script src="../../content/shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -27,7 +27,7 @@
|
||||
window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
|
||||
</script>
|
||||
<script src="../content/shared/libs/sdk.js"></script>
|
||||
<script src="../content/shared/libs/react-0.11.1.js"></script>
|
||||
<script src="../content/shared/libs/react-0.11.2.js"></script>
|
||||
<script src="../content/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script src="../content/shared/libs/lodash-2.4.1.js"></script>
|
||||
<script src="../content/shared/libs/backbone-1.1.2.js"></script>
|
||||
|
@ -1017,10 +1017,6 @@ let SessionStoreInternal = {
|
||||
SessionCookies.update([winData]);
|
||||
}
|
||||
|
||||
// Until we decide otherwise elsewhere, this window is part of a series
|
||||
// of closing windows to quit.
|
||||
RevivableWindows.add(winData);
|
||||
|
||||
// Store the window's close date to figure out when each individual tab
|
||||
// was closed. This timestamp should allow re-arranging data based on how
|
||||
// recently something was closed.
|
||||
@ -1051,6 +1047,10 @@ let SessionStoreInternal = {
|
||||
this._closedWindows.unshift(winData);
|
||||
this._capClosedWindows();
|
||||
}
|
||||
|
||||
// Until we decide otherwise elsewhere, this window
|
||||
// is part of a series of closing windows to quit.
|
||||
RevivableWindows.add(winData);
|
||||
}
|
||||
|
||||
// clear this window from the list
|
||||
|
@ -39,6 +39,16 @@ add_task(function* test_revive_windows() {
|
||||
yield promiseBrowserLoaded(tab.linkedBrowser);
|
||||
}
|
||||
|
||||
// Create a private window.
|
||||
// This window must not be revived.
|
||||
{
|
||||
let win = yield promiseNewWindow({private: true});
|
||||
windows.push(win);
|
||||
|
||||
let tab = win.gBrowser.addTab("about:mozilla");
|
||||
yield promiseBrowserLoaded(tab.linkedBrowser);
|
||||
}
|
||||
|
||||
// Close all windows.
|
||||
for (let win of windows) {
|
||||
yield promiseWindowClosed(win);
|
||||
@ -139,8 +149,8 @@ add_task(function* test_revive_windows_order() {
|
||||
}
|
||||
});
|
||||
|
||||
function promiseNewWindow() {
|
||||
return new Promise(resolve => whenNewWindowLoaded({private: false}, resolve));
|
||||
function promiseNewWindow(opts = {private: false}) {
|
||||
return new Promise(resolve => whenNewWindowLoaded(opts, resolve));
|
||||
}
|
||||
|
||||
function forgetClosedWindows() {
|
||||
|
@ -14,6 +14,7 @@ this.EXPORTED_SYMBOLS = [ "PluginContent" ];
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
Cu.import("resource://gre/modules/BrowserUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gNavigatorBundle", function() {
|
||||
const url = "chrome://browser/locale/browser.properties";
|
||||
@ -119,7 +120,7 @@ PluginContent.prototype = {
|
||||
|
||||
if (this.isKnownPlugin(pluginElement)) {
|
||||
pluginTag = pluginHost.getPluginTagForType(pluginElement.actualType);
|
||||
pluginName = this.makeNicePluginName(pluginTag.name);
|
||||
pluginName = BrowserUtils.makeNicePluginName(pluginTag.name);
|
||||
|
||||
permissionString = pluginHost.getPermissionStringForType(pluginElement.actualType);
|
||||
fallbackType = pluginElement.defaultFallbackType;
|
||||
@ -142,26 +143,6 @@ PluginContent.prototype = {
|
||||
};
|
||||
},
|
||||
|
||||
// Map the plugin's name to a filtered version more suitable for user UI.
|
||||
makeNicePluginName : function (aName) {
|
||||
if (aName == "Shockwave Flash")
|
||||
return "Adobe Flash";
|
||||
// Regex checks if aName begins with "Java" + non-letter char
|
||||
if (/^Java\W/.exec(aName))
|
||||
return "Java";
|
||||
|
||||
// Clean up the plugin name by stripping off parenthetical clauses,
|
||||
// trailing version numbers or "plugin".
|
||||
// EG, "Foo Bar (Linux) Plugin 1.23_02" --> "Foo Bar"
|
||||
// Do this by first stripping the numbers, etc. off the end, and then
|
||||
// removing "Plugin" (and then trimming to get rid of any whitespace).
|
||||
// (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
|
||||
let newName = aName.replace(/\(.*?\)/g, "").
|
||||
replace(/[\s\d\.\-\_\(\)]+$/, "").
|
||||
replace(/\bplug-?in\b/i, "").trim();
|
||||
return newName;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the visibility of the plugin overlay.
|
||||
*/
|
||||
@ -843,7 +824,7 @@ PluginContent.prototype = {
|
||||
|
||||
// For non-GMP plugins, remap the plugin name to a more user-presentable form.
|
||||
if (!gmpPlugin) {
|
||||
pluginName = this.makeNicePluginName(pluginName);
|
||||
pluginName = BrowserUtils.makeNicePluginName(pluginName);
|
||||
}
|
||||
|
||||
let messageString = gNavigatorBundle.formatStringFromName("crashedpluginsMessage.title", [pluginName], 1);
|
||||
|
@ -146,7 +146,7 @@ panelmultiview[nosubviews=true] > .panel-viewcontainer > .panel-viewstack > .pan
|
||||
margin: -4px -4px 4px;
|
||||
box-shadow: 0 -1px 0 hsla(210,4%,10%,.05) inset;
|
||||
color: GrayText;
|
||||
text-transform: uppercase;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
.cui-widget-panelview .panel-subview-header {
|
||||
|
@ -609,6 +609,7 @@ GK_ATOM(mozfullscreenerror, "mozfullscreenerror")
|
||||
GK_ATOM(mozpasspointerevents, "mozpasspointerevents")
|
||||
GK_ATOM(mozpointerlockchange, "mozpointerlockchange")
|
||||
GK_ATOM(mozpointerlockerror, "mozpointerlockerror")
|
||||
GK_ATOM(mozprivatebrowsing, "mozprivatebrowsing")
|
||||
GK_ATOM(moz_opaque, "moz-opaque")
|
||||
GK_ATOM(moz_action_hint, "mozactionhint")
|
||||
GK_ATOM(x_moz_errormessage, "x-moz-errormessage")
|
||||
|
@ -851,6 +851,7 @@ nsDocShell::nsDocShell():
|
||||
#endif
|
||||
mAffectPrivateSessionLifetime(true),
|
||||
mInvisible(false),
|
||||
mHasLoadedNonBlankURI(false),
|
||||
mDefaultLoadFlags(nsIRequest::LOAD_NORMAL),
|
||||
mFrameType(eFrameTypeRegular),
|
||||
mOwnOrContainingAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID),
|
||||
@ -1928,6 +1929,10 @@ nsDocShell::SetCurrentURI(nsIURI *aURI, nsIRequest *aRequest,
|
||||
|
||||
mCurrentURI = NS_TryToMakeImmutable(aURI);
|
||||
|
||||
if (!NS_IsAboutBlank(mCurrentURI)) {
|
||||
mHasLoadedNonBlankURI = true;
|
||||
}
|
||||
|
||||
bool isRoot = false; // Is this the root docshell
|
||||
bool isSubFrame = false; // Is this a subframe navigation?
|
||||
|
||||
@ -2277,6 +2282,15 @@ nsDocShell::SetPrivateBrowsing(bool aUsePrivateBrowsing)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetHasLoadedNonBlankURI(bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = mHasLoadedNonBlankURI;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetUseRemoteTabs(bool* aUseRemoteTabs)
|
||||
{
|
||||
|
@ -915,6 +915,7 @@ protected:
|
||||
#endif
|
||||
bool mAffectPrivateSessionLifetime;
|
||||
bool mInvisible;
|
||||
bool mHasLoadedNonBlankURI;
|
||||
uint64_t mHistoryID;
|
||||
uint32_t mDefaultLoadFlags;
|
||||
|
||||
|
@ -54,7 +54,7 @@ interface nsITabParent;
|
||||
|
||||
typedef unsigned long nsLoadFlags;
|
||||
|
||||
[scriptable, builtinclass, uuid(2b8e4a50-7744-454d-a05b-debead8070fe)]
|
||||
[scriptable, builtinclass, uuid(23157a63-26fd-44a0-a0f9-fdc64dcc004c)]
|
||||
interface nsIDocShell : nsIDocShellTreeItem
|
||||
{
|
||||
/**
|
||||
@ -1017,4 +1017,11 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||
|
||||
// URLSearchParams for the window.location is owned by the docShell.
|
||||
[noscript,notxpcom] URLSearchParams getURLSearchParams();
|
||||
|
||||
/**
|
||||
* This attribute determines whether a document which is not about:blank has
|
||||
* already be loaded by this docShell.
|
||||
*/
|
||||
[infallible] readonly attribute boolean hasLoadedNonBlankURI;
|
||||
|
||||
};
|
||||
|
@ -56,3 +56,10 @@ let infos = sendSyncMessage('browser-element-api:call',
|
||||
{ 'msg_name': 'hello' })[0];
|
||||
docShell.QueryInterface(Ci.nsIDocShellTreeItem).name = infos.name;
|
||||
docShell.setFullscreenAllowed(infos.fullscreenAllowed);
|
||||
if (infos.isPrivate) {
|
||||
if (docShell.hasLoadedNonBlankURI) {
|
||||
Cu.reportError("We should not switch to Private Browsing after loading a document.");
|
||||
} else {
|
||||
docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing = true;
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,14 @@ CreateIframe(Element* aOpenerFrameElement, const nsAString& aName, bool aRemote)
|
||||
NS_LITERAL_STRING("false"),
|
||||
/* aNotify = */ false);
|
||||
|
||||
// Copy the opener frame's mozprivatebrowsing attribute to the popup frame.
|
||||
nsAutoString mozprivatebrowsing;
|
||||
if (aOpenerFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::mozprivatebrowsing,
|
||||
mozprivatebrowsing)) {
|
||||
popupFrameElement->SetAttr(kNameSpaceID_None, nsGkAtoms::mozprivatebrowsing,
|
||||
mozprivatebrowsing, /* aNotify = */ false);
|
||||
}
|
||||
|
||||
return popupFrameElement.forget();
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,8 @@ BrowserElementParent.prototype = {
|
||||
name: this._frameElement.getAttribute('name'),
|
||||
fullscreenAllowed:
|
||||
this._frameElement.hasAttribute('allowfullscreen') ||
|
||||
this._frameElement.hasAttribute('mozallowfullscreen')
|
||||
this._frameElement.hasAttribute('mozallowfullscreen'),
|
||||
isPrivate: this._frameElement.hasAttribute('mozprivatebrowsing')
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -0,0 +1,50 @@
|
||||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test that the mozprivatebrowsing attribute works.
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
function createFrame(aIsPrivate) {
|
||||
var iframe = document.createElement("iframe");
|
||||
SpecialPowers.wrap(iframe).mozbrowser = true;
|
||||
if (aIsPrivate) {
|
||||
iframe.setAttribute("mozprivatebrowsing", "true");
|
||||
}
|
||||
return iframe;
|
||||
}
|
||||
|
||||
function createTest(aIsPrivate, aExpected, aClearStorage) {
|
||||
info("createTest " + aIsPrivate + " " + aExpected);
|
||||
var deferred = Promise.defer();
|
||||
|
||||
var iframe = createFrame(aIsPrivate);
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
|
||||
is(e.detail.message, aExpected, "Checking localstorage");
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
var src = "file_browserElement_PrivateBrowsing.html";
|
||||
iframe.src = aClearStorage ? src + "?clear=true" : src;
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// We first create a iframe in non private browsing mode, set up some
|
||||
// localstorage, reopen it to check that we get the previously set value.
|
||||
// Finally, open it in private browsing mode and check that localstorage
|
||||
// is clear.
|
||||
createTest(false, "CLEAR", true)
|
||||
.then(() => { return createTest(false, "EMPTY", false); })
|
||||
.then(() => { return createTest(false, "bar", false); })
|
||||
.then(() => { return createTest(true, "EMPTY", false); })
|
||||
.then(SimpleTest.finish);
|
||||
}
|
||||
|
||||
addEventListener("testready", runTest);
|
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
if (location.href.indexOf("clear=true") != -1) {
|
||||
localStorage.removeItem("foo");
|
||||
alert("CLEAR");
|
||||
} else {
|
||||
var initialValue = localStorage.getItem("foo") || "EMPTY";
|
||||
localStorage.setItem("foo", "bar");
|
||||
alert(initialValue);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -59,6 +59,7 @@ skip-if = (toolkit == 'gonk' && !debug)
|
||||
[test_browserElement_oop_OpenWindowRejected.html]
|
||||
skip-if = (toolkit == 'gonk' && !debug)
|
||||
[test_browserElement_oop_Opensearch.html]
|
||||
[test_browserElement_oop_PrivateBrowsing.html]
|
||||
[test_browserElement_oop_PromptCheck.html]
|
||||
[test_browserElement_oop_PromptConfirm.html]
|
||||
[test_browserElement_oop_PurgeHistory.html]
|
||||
|
@ -43,6 +43,7 @@ support-files =
|
||||
browserElement_OpenWindowInFrame.js
|
||||
browserElement_OpenWindowRejected.js
|
||||
browserElement_Opensearch.js
|
||||
browserElement_PrivateBrowsing.js
|
||||
browserElement_PromptCheck.js
|
||||
browserElement_PromptConfirm.js
|
||||
browserElement_PurgeHistory.js
|
||||
@ -89,6 +90,7 @@ support-files =
|
||||
file_browserElement_OpenWindowDifferentOrigin.html
|
||||
file_browserElement_OpenWindowInFrame.html
|
||||
file_browserElement_OpenWindowRejected.html
|
||||
file_browserElement_PrivateBrowsing.html
|
||||
file_browserElement_SecurityChange.html
|
||||
file_browserElement_SetVisibleFrames2_Outer.html
|
||||
file_browserElement_SetVisibleFrames_Inner.html
|
||||
@ -170,6 +172,7 @@ skip-if = (toolkit == 'gonk' && !debug)
|
||||
[test_browserElement_inproc_OpenWindowRejected.html]
|
||||
skip-if = (toolkit == 'gonk' && !debug)
|
||||
[test_browserElement_inproc_Opensearch.html]
|
||||
[test_browserElement_inproc_PrivateBrowsing.html]
|
||||
[test_browserElement_inproc_PromptCheck.html]
|
||||
[test_browserElement_inproc_PromptConfirm.html]
|
||||
[test_browserElement_inproc_PurgeHistory.html]
|
||||
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=832700
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 832700</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=832700">Mozilla Bug 832700</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_PrivateBrowsing.js">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=832700
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 832700</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=832700">Mozilla Bug 832700</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_PrivateBrowsing.js">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -15,7 +15,7 @@ this.EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ];
|
||||
* same thread.
|
||||
*
|
||||
* For documentation on the API, see:
|
||||
* https://wiki.mozilla.org/Debugger
|
||||
* https://developer.mozilla.org/en-US/docs/Tools/Debugger-API
|
||||
*/
|
||||
|
||||
const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger);
|
||||
|
@ -250,7 +250,8 @@ public final class ANRReporter extends BroadcastReceiver
|
||||
Log.d(LOGTAG, "uptime " + String.valueOf(uptimeMins));
|
||||
}
|
||||
return uptimeMins;
|
||||
} else if (DEBUG) {
|
||||
}
|
||||
if (DEBUG) {
|
||||
Log.d(LOGTAG, "could not get uptime");
|
||||
}
|
||||
return 0L;
|
||||
|
@ -62,6 +62,7 @@ class ActionModeCompatView extends LinearLayout implements GeckoMenu.ActionItemB
|
||||
((GeckoMenu) mPopupMenu.getMenu()).setActionItemBarPresenter(this);
|
||||
|
||||
mMenuButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
openMenu();
|
||||
}
|
||||
@ -90,6 +91,7 @@ class ActionModeCompatView extends LinearLayout implements GeckoMenu.ActionItemB
|
||||
return mPopupMenu.getMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// onFinishInflate may not have been called yet on some versions of Android
|
||||
if (mPopupMenu != null && mMenuButton != null) {
|
||||
|
@ -258,7 +258,9 @@ public class AndroidGamepadManager {
|
||||
// Queue up key events for pending devices.
|
||||
sPendingGamepads.get(deviceId).add(ev);
|
||||
return true;
|
||||
} else if (!sGamepads.containsKey(deviceId)) {
|
||||
}
|
||||
|
||||
if (!sGamepads.containsKey(deviceId)) {
|
||||
InputDevice device = ev.getDevice();
|
||||
if (device != null &&
|
||||
(device.getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
|
||||
@ -332,6 +334,7 @@ public class AndroidGamepadManager {
|
||||
// Poll known gamepads to see if they've disappeared.
|
||||
sPollTimer = new Timer();
|
||||
sPollTimer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (Integer deviceId : sGamepads.keySet()) {
|
||||
if (InputDevice.getDevice(deviceId) == null) {
|
||||
@ -343,6 +346,7 @@ public class AndroidGamepadManager {
|
||||
return;
|
||||
}
|
||||
sListener = new InputManager.InputDeviceListener() {
|
||||
@Override
|
||||
public void onInputDeviceAdded(int deviceId) {
|
||||
InputDevice device = InputDevice.getDevice(deviceId);
|
||||
if (device == null) {
|
||||
@ -353,6 +357,7 @@ public class AndroidGamepadManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputDeviceRemoved(int deviceId) {
|
||||
if (sPendingGamepads.containsKey(deviceId)) {
|
||||
// Got removed before Gecko's ack reached us.
|
||||
@ -365,6 +370,7 @@ public class AndroidGamepadManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputDeviceChanged(int deviceId) {
|
||||
}
|
||||
};
|
||||
|
@ -35,6 +35,7 @@ public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeckoProfile getProfile() {
|
||||
// Fall back to default profile if we didn't load a specific one
|
||||
if (mProfile == null) {
|
||||
@ -44,32 +45,39 @@ public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
|
||||
}
|
||||
|
||||
// Bug 908770: Implement this
|
||||
@Override
|
||||
public PromptService getPromptService() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return (Activity)mContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultUAString() {
|
||||
return HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET :
|
||||
AppConstants.USER_AGENT_FENNEC_MOBILE;
|
||||
}
|
||||
|
||||
// Bug 908772: Implement this
|
||||
@Override
|
||||
public LocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bug 908773: Implement this
|
||||
@Override
|
||||
public SensorEventListener getSensorEventListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bug 908775: Implement this
|
||||
@Override
|
||||
public void doRestart() {}
|
||||
|
||||
@Override
|
||||
public void setFullScreen(final boolean fullscreen) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -80,53 +88,67 @@ public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
|
||||
}
|
||||
|
||||
// Bug 908779: Implement this
|
||||
@Override
|
||||
public void addPluginView(final View view, final RectF rect, final boolean isFullScreen) {}
|
||||
|
||||
// Bug 908781: Implement this
|
||||
@Override
|
||||
public void removePluginView(final View view, final boolean isFullScreen) {}
|
||||
|
||||
// Bug 908783: Implement this
|
||||
@Override
|
||||
public void enableCameraView() {}
|
||||
|
||||
// Bug 908785: Implement this
|
||||
@Override
|
||||
public void disableCameraView() {}
|
||||
|
||||
// Bug 908786: Implement this
|
||||
@Override
|
||||
public void addAppStateListener(GeckoAppShell.AppStateListener listener) {}
|
||||
|
||||
// Bug 908787: Implement this
|
||||
@Override
|
||||
public void removeAppStateListener(GeckoAppShell.AppStateListener listener) {}
|
||||
|
||||
// Bug 908788: Implement this
|
||||
@Override
|
||||
public View getCameraView() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bug 908789: Implement this
|
||||
@Override
|
||||
public void notifyWakeLockChanged(String topic, String state) {}
|
||||
|
||||
// Bug 908790: Implement this
|
||||
@Override
|
||||
public FormAssistPopup getFormAssistPopup() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areTabsShown() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bug 908791: Implement this
|
||||
@Override
|
||||
public AbsoluteLayout getPluginContainer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyCheckUpdateResult(String result) {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Update:CheckResult", result));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTabsSideBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bug 908792: Implement this
|
||||
@Override
|
||||
public void invalidateOptionsMenu() {}
|
||||
}
|
||||
|
@ -860,24 +860,28 @@ public class BrowserApp extends GeckoApp
|
||||
|
||||
private void setBrowserToolbarListeners() {
|
||||
mBrowserToolbar.setOnActivateListener(new BrowserToolbar.OnActivateListener() {
|
||||
@Override
|
||||
public void onActivate() {
|
||||
enterEditingMode();
|
||||
}
|
||||
});
|
||||
|
||||
mBrowserToolbar.setOnCommitListener(new BrowserToolbar.OnCommitListener() {
|
||||
@Override
|
||||
public void onCommit() {
|
||||
commitEditingMode();
|
||||
}
|
||||
});
|
||||
|
||||
mBrowserToolbar.setOnDismissListener(new BrowserToolbar.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
mBrowserToolbar.cancelEdit();
|
||||
}
|
||||
});
|
||||
|
||||
mBrowserToolbar.setOnFilterListener(new BrowserToolbar.OnFilterListener() {
|
||||
@Override
|
||||
public void onFilter(String searchText, AutocompleteHandler handler) {
|
||||
filterEditingMode(searchText, handler);
|
||||
}
|
||||
@ -893,6 +897,7 @@ public class BrowserApp extends GeckoApp
|
||||
});
|
||||
|
||||
mBrowserToolbar.setOnStartEditingListener(new BrowserToolbar.OnStartEditingListener() {
|
||||
@Override
|
||||
public void onStartEditing() {
|
||||
// Temporarily disable doorhanger notifications.
|
||||
mDoorHangerPopup.disable();
|
||||
@ -900,6 +905,7 @@ public class BrowserApp extends GeckoApp
|
||||
});
|
||||
|
||||
mBrowserToolbar.setOnStopEditingListener(new BrowserToolbar.OnStopEditingListener() {
|
||||
@Override
|
||||
public void onStopEditing() {
|
||||
selectTargetTabForEditingMode();
|
||||
|
||||
@ -1253,6 +1259,7 @@ public class BrowserApp extends GeckoApp
|
||||
mDynamicToolbarCanScroll = false;
|
||||
if (mBrowserChrome.getVisibility() != View.VISIBLE) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mDynamicToolbar.setVisible(true, VisibilityTransition.ANIMATE);
|
||||
}
|
||||
@ -1267,6 +1274,7 @@ public class BrowserApp extends GeckoApp
|
||||
final ToolbarProgressView progressView = mProgressView;
|
||||
final int marginTop = Math.round(aMetrics.marginTop);
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final float translationY = marginTop - browserChrome.getHeight();
|
||||
ViewHelper.setTranslationY(browserChrome, translationY);
|
||||
|
@ -75,6 +75,7 @@ public class BrowserLocaleManager implements LocaleManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return AppConstants.MOZ_LOCALE_SWITCHER;
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
|
||||
// This dumps everything we can find about the device into JSON. This will hopefully make it
|
||||
// easier to filter out duplicate devices from different sources in js.
|
||||
@Override
|
||||
public JSONObject toJSON() {
|
||||
final JSONObject obj = new JSONObject();
|
||||
try {
|
||||
@ -175,6 +176,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(final String title, final String url, final String type, final EventCallback callback) {
|
||||
final CastDevice device = CastDevice.getFromBundle(route.getExtras());
|
||||
Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions.builder(device, new Cast.Listener() {
|
||||
@ -218,11 +220,13 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
apiClient.connect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(final EventCallback callback) {
|
||||
// Nothing to be done here
|
||||
callback.sendSuccess(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(final EventCallback callback) {
|
||||
// Nothing to be done here
|
||||
callback.sendSuccess(null);
|
||||
@ -249,6 +253,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void play(final EventCallback callback) {
|
||||
if (!verifySession(callback)) {
|
||||
return;
|
||||
@ -273,6 +278,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause(final EventCallback callback) {
|
||||
if (!verifySession(callback)) {
|
||||
return;
|
||||
@ -297,6 +303,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end(final EventCallback callback) {
|
||||
if (!verifySession(callback)) {
|
||||
return;
|
||||
@ -376,6 +383,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResult(ApplicationConnectionResult result) {
|
||||
Status status = result.getStatus();
|
||||
if (status.isSuccess()) {
|
||||
@ -405,12 +413,14 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void message(String msg, final EventCallback callback) {
|
||||
if (mMirrorChannel != null) {
|
||||
mMirrorChannel.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mirror(final EventCallback callback) {
|
||||
final CastDevice device = CastDevice.getFromBundle(route.getExtras());
|
||||
Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions.builder(device, new Cast.Listener() {
|
||||
|
@ -247,9 +247,7 @@ public class ContactService implements GeckoEventListener {
|
||||
// Truncate the raw contacts IDs array if necessary
|
||||
if (filterLimit > 0 && allRawContactIds.length > filterLimit) {
|
||||
long[] truncatedRawContactIds = new long[filterLimit];
|
||||
for (int i = 0; i < filterLimit; i++) {
|
||||
truncatedRawContactIds[i] = allRawContactIds[i];
|
||||
}
|
||||
System.arraycopy(allRawContactIds, 0, truncatedRawContactIds, 0, filterLimit);
|
||||
return truncatedRawContactIds;
|
||||
}
|
||||
return allRawContactIds;
|
||||
@ -402,41 +400,47 @@ public class ContactService implements GeckoEventListener {
|
||||
filterValue = filterValue.toLowerCase();
|
||||
databaseValue = databaseValue.toLowerCase();
|
||||
|
||||
if ("match".equals(filterOp)) {
|
||||
// If substring matching is a positive number, only pay attention to the last X characters
|
||||
// of both the filter and database values
|
||||
if (substringMatching > 0) {
|
||||
databaseValue = substringStartFromEnd(cleanPhoneNumber(databaseValue), substringMatching);
|
||||
filterValue = substringStartFromEnd(cleanPhoneNumber(filterValue), substringMatching);
|
||||
return databaseValue.startsWith(filterValue);
|
||||
}
|
||||
return databaseValue.equals(filterValue);
|
||||
} else if ("equals".equals(filterOp)) {
|
||||
if (isPhone) {
|
||||
return PhoneNumberUtils.compare(filterValue, databaseValue);
|
||||
}
|
||||
return databaseValue.equals(filterValue);
|
||||
} else if ("contains".equals(filterOp)) {
|
||||
if (isPhone) {
|
||||
filterValue = cleanPhoneNumber(filterValue);
|
||||
databaseValue = cleanPhoneNumber(databaseValue);
|
||||
}
|
||||
return databaseValue.contains(filterValue);
|
||||
} else if ("startsWith".equals(filterOp)) {
|
||||
// If a phone number, remove non-dialable characters and then only pay attention to
|
||||
// the last X digits given by the substring matching values (see bug 877302)
|
||||
if (isPhone) {
|
||||
String cleanedDatabasePhone = cleanPhoneNumber(databaseValue);
|
||||
switch (filterOp) {
|
||||
case "match":
|
||||
// If substring matching is a positive number, only pay attention to the last X characters
|
||||
// of both the filter and database values
|
||||
if (substringMatching > 0) {
|
||||
cleanedDatabasePhone = substringStartFromEnd(cleanedDatabasePhone, substringMatching);
|
||||
databaseValue = substringStartFromEnd(cleanPhoneNumber(databaseValue), substringMatching);
|
||||
filterValue = substringStartFromEnd(cleanPhoneNumber(filterValue), substringMatching);
|
||||
return databaseValue.startsWith(filterValue);
|
||||
}
|
||||
|
||||
if (cleanedDatabasePhone.startsWith(filterValue)) {
|
||||
return true;
|
||||
return databaseValue.equals(filterValue);
|
||||
case "equals":
|
||||
if (isPhone) {
|
||||
return PhoneNumberUtils.compare(filterValue, databaseValue);
|
||||
}
|
||||
}
|
||||
return databaseValue.startsWith(filterValue);
|
||||
|
||||
return databaseValue.equals(filterValue);
|
||||
case "contains":
|
||||
if (isPhone) {
|
||||
filterValue = cleanPhoneNumber(filterValue);
|
||||
databaseValue = cleanPhoneNumber(databaseValue);
|
||||
}
|
||||
|
||||
return databaseValue.contains(filterValue);
|
||||
case "startsWith":
|
||||
// If a phone number, remove non-dialable characters and then only pay attention to
|
||||
// the last X digits given by the substring matching values (see bug 877302)
|
||||
if (isPhone) {
|
||||
String cleanedDatabasePhone = cleanPhoneNumber(databaseValue);
|
||||
if (substringMatching > 0) {
|
||||
cleanedDatabasePhone = substringStartFromEnd(cleanedDatabasePhone, substringMatching);
|
||||
}
|
||||
|
||||
if (cleanedDatabasePhone.startsWith(filterValue)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return databaseValue.startsWith(filterValue);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -659,7 +663,7 @@ public class ContactService implements GeckoEventListener {
|
||||
}
|
||||
|
||||
private boolean bool(int integer) {
|
||||
return integer != 0 ? true : false;
|
||||
return integer != 0;
|
||||
}
|
||||
|
||||
private void getGenericDataAsJSONObject(Cursor cursor, JSONArray array, final String dataColumn,
|
||||
@ -1558,6 +1562,7 @@ public class ContactService implements GeckoEventListener {
|
||||
});
|
||||
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
builder.show();
|
||||
}
|
||||
|
@ -255,10 +255,12 @@ public final class EventDispatcher {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSuccess(final Object response) {
|
||||
sendResponse(STATUS_SUCCESS, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendError(final Object response) {
|
||||
sendResponse(STATUS_ERROR, response);
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ public class FilePicker implements GeckoEventListener {
|
||||
mimeType = GeckoAppShell.getMimeTypeFromExtensions(message.optString("extensions"));
|
||||
|
||||
showFilePickerAsync(title, mimeType, new ResultHandler() {
|
||||
@Override
|
||||
public void gotFile(String filename) {
|
||||
try {
|
||||
message.put("file", filename);
|
||||
@ -198,7 +199,7 @@ public class FilePicker implements GeckoEventListener {
|
||||
title = getFilePickerTitle(mimeType);
|
||||
}
|
||||
Intent chooser = Intent.createChooser(base, title);
|
||||
chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intents.toArray(new Parcelable[]{}));
|
||||
chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intents.toArray(new Parcelable[intents.size()]));
|
||||
handler.gotIntent(chooser);
|
||||
}
|
||||
|
||||
|
@ -73,13 +73,13 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
|
||||
private static final String LOGTAG = "GeckoFormAssistPopup";
|
||||
|
||||
// The blocklist is so short that ArrayList is probably cheaper than HashSet.
|
||||
private static final Collection<String> sInputMethodBlocklist = Arrays.asList(new String[] {
|
||||
private static final Collection<String> sInputMethodBlocklist = Arrays.asList(
|
||||
InputMethods.METHOD_GOOGLE_JAPANESE_INPUT, // bug 775850
|
||||
InputMethods.METHOD_OPENWNN_PLUS, // bug 768108
|
||||
InputMethods.METHOD_SIMEJI, // bug 768108
|
||||
InputMethods.METHOD_SWYPE, // bug 755909
|
||||
InputMethods.METHOD_SWYPE_BETA, // bug 755909
|
||||
});
|
||||
InputMethods.METHOD_SWYPE_BETA // bug 755909
|
||||
);
|
||||
|
||||
public FormAssistPopup(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
@ -263,6 +263,7 @@ public class GeckoAccessibility {
|
||||
AccessibilityManager accessibilityManager =
|
||||
(AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
accessibilityManager.addAccessibilityStateChangeListener(new AccessibilityManager.AccessibilityStateChangeListener() {
|
||||
@Override
|
||||
public void onAccessibilityStateChanged(boolean enabled) {
|
||||
updateAccessibilitySettings(context);
|
||||
}
|
||||
|
@ -198,6 +198,7 @@ public abstract class GeckoApp
|
||||
private EventListener mWebappEventListener;
|
||||
|
||||
abstract public int getLayout();
|
||||
@Override
|
||||
abstract public boolean hasTabsSideBar();
|
||||
abstract protected String getDefaultProfileName() throws NoMozillaDirectoryException;
|
||||
|
||||
@ -229,30 +230,37 @@ public abstract class GeckoApp
|
||||
return GeckoSharedPrefs.forApp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocationListener getLocationListener() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SensorEventListener getSensorEventListener() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getCameraView() {
|
||||
return mCameraView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAppStateListener(GeckoAppShell.AppStateListener listener) {
|
||||
mAppStateListeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAppStateListener(GeckoAppShell.AppStateListener listener) {
|
||||
mAppStateListeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FormAssistPopup getFormAssistPopup() {
|
||||
return mFormAssistPopup;
|
||||
}
|
||||
@ -537,6 +545,7 @@ public abstract class GeckoApp
|
||||
*/
|
||||
public boolean autoHideTabs() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean areTabsShown() { return false; }
|
||||
|
||||
@Override
|
||||
@ -862,6 +871,7 @@ public abstract class GeckoApp
|
||||
mFullScreenPluginView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPluginView(final View view, final RectF rect, final boolean isFullScreen) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -919,6 +929,7 @@ public abstract class GeckoApp
|
||||
setFullScreen(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePluginView(final View view, final boolean isFullScreen) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1071,6 +1082,7 @@ public abstract class GeckoApp
|
||||
requestRender();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFullScreen(final boolean fullscreen) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1658,6 +1670,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized GeckoProfile getProfile() {
|
||||
// fall back to default profile if we didn't load a specific one
|
||||
if (mProfile == null) {
|
||||
@ -1722,6 +1735,7 @@ public abstract class GeckoApp
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableCameraView() {
|
||||
// Start listening for orientation events
|
||||
mCameraOrientationEventListener = new OrientationEventListener(this) {
|
||||
@ -1737,7 +1751,7 @@ public abstract class GeckoApp
|
||||
mCameraOrientationEventListener.enable();
|
||||
|
||||
// Try to make it fully transparent.
|
||||
if (mCameraView != null && (mCameraView instanceof SurfaceView)) {
|
||||
if (mCameraView instanceof SurfaceView) {
|
||||
if (Versions.feature11Plus) {
|
||||
mCameraView.setAlpha(0.0f);
|
||||
}
|
||||
@ -1748,6 +1762,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCameraView() {
|
||||
if (mCameraOrientationEventListener != null) {
|
||||
mCameraOrientationEventListener.disable();
|
||||
@ -1759,6 +1774,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultUAString() {
|
||||
return HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET :
|
||||
AppConstants.USER_AGENT_FENNEC_MOBILE;
|
||||
@ -2119,6 +2135,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRestart() {
|
||||
doRestart(RESTARTER_ACTION, null, null);
|
||||
}
|
||||
@ -2222,6 +2239,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PromptService getPromptService() {
|
||||
return mPromptService;
|
||||
}
|
||||
@ -2287,6 +2305,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbsoluteLayout getPluginContainer() { return mPluginContainer; }
|
||||
|
||||
// Accelerometer.
|
||||
@ -2325,6 +2344,7 @@ public abstract class GeckoApp
|
||||
private static final String SCREEN = "screen";
|
||||
|
||||
// Called when a Gecko Hal WakeLock is changed
|
||||
@Override
|
||||
public void notifyWakeLockChanged(String topic, String state) {
|
||||
PowerManager.WakeLock wl = mWakeLocks.get(topic);
|
||||
if (state.equals("locked-foreground") && wl == null) {
|
||||
@ -2346,6 +2366,7 @@ public abstract class GeckoApp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyCheckUpdateResult(String result) {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Update:CheckResult", result));
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ public class GeckoJavaSampler {
|
||||
mSampleCount = aSampleCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (GeckoJavaSampler.class) {
|
||||
mSamples.put(0, new Sample[mSampleCount]);
|
||||
|
@ -280,9 +280,12 @@ public class GeckoNetworkManager extends BroadcastReceiver implements NativeEven
|
||||
if (networkOperator == null || networkOperator.length() <= 3) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (type == InfoType.MNC) {
|
||||
return Integer.parseInt(networkOperator.substring(3));
|
||||
} else if (type == InfoType.MCC) {
|
||||
}
|
||||
|
||||
if (type == InfoType.MCC) {
|
||||
return Integer.parseInt(networkOperator.substring(0, 3));
|
||||
}
|
||||
|
||||
|
@ -298,24 +298,21 @@ public class GeckoScreenOrientation {
|
||||
* otherwise.
|
||||
*/
|
||||
public static ScreenOrientation screenOrientationFromString(String aStr) {
|
||||
if ("portrait".equals(aStr)) {
|
||||
return ScreenOrientation.PORTRAIT_PRIMARY;
|
||||
}
|
||||
else if ("landscape".equals(aStr)) {
|
||||
return ScreenOrientation.LANDSCAPE_PRIMARY;
|
||||
}
|
||||
else if ("portrait-primary".equals(aStr)) {
|
||||
return ScreenOrientation.PORTRAIT_PRIMARY;
|
||||
}
|
||||
else if ("portrait-secondary".equals(aStr)) {
|
||||
return ScreenOrientation.PORTRAIT_SECONDARY;
|
||||
}
|
||||
else if ("landscape-primary".equals(aStr)) {
|
||||
return ScreenOrientation.LANDSCAPE_PRIMARY;
|
||||
}
|
||||
else if ("landscape-secondary".equals(aStr)) {
|
||||
return ScreenOrientation.LANDSCAPE_SECONDARY;
|
||||
switch (aStr) {
|
||||
case "portrait":
|
||||
return ScreenOrientation.PORTRAIT_PRIMARY;
|
||||
case "landscape":
|
||||
return ScreenOrientation.LANDSCAPE_PRIMARY;
|
||||
case "portrait-primary":
|
||||
return ScreenOrientation.PORTRAIT_PRIMARY;
|
||||
case "portrait-secondary":
|
||||
return ScreenOrientation.PORTRAIT_SECONDARY;
|
||||
case "landscape-primary":
|
||||
return ScreenOrientation.LANDSCAPE_PRIMARY;
|
||||
case "landscape-secondary":
|
||||
return ScreenOrientation.LANDSCAPE_SECONDARY;
|
||||
}
|
||||
|
||||
Log.w(LOGTAG, "screenOrientationFromString: unknown orientation string");
|
||||
return DEFAULT_SCREEN_ORIENTATION;
|
||||
}
|
||||
|
@ -354,6 +354,7 @@ public class GeckoView extends LayerView
|
||||
return DEFAULT_SHARED_PREFERENCES_FILE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences() {
|
||||
return getContext().getSharedPreferences(getSharedPreferencesFile(), 0);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ public class GeckoViewChrome implements GeckoView.ChromeDelegate {
|
||||
* Tell the host application that Gecko is ready to handle requests.
|
||||
* @param view The GeckoView that initiated the callback.
|
||||
*/
|
||||
@Override
|
||||
public void onReady(GeckoView view) {}
|
||||
|
||||
/**
|
||||
@ -20,6 +21,7 @@ public class GeckoViewChrome implements GeckoView.ChromeDelegate {
|
||||
* @param result A PromptResult used to send back the result without blocking.
|
||||
* Defaults to cancel requests.
|
||||
*/
|
||||
@Override
|
||||
public void onAlert(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) {
|
||||
result.cancel();
|
||||
}
|
||||
@ -32,6 +34,7 @@ public class GeckoViewChrome implements GeckoView.ChromeDelegate {
|
||||
* @param result A PromptResult used to send back the result without blocking.
|
||||
* Defaults to cancel requests.
|
||||
*/
|
||||
@Override
|
||||
public void onConfirm(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) {
|
||||
result.cancel();
|
||||
}
|
||||
@ -45,6 +48,7 @@ public class GeckoViewChrome implements GeckoView.ChromeDelegate {
|
||||
* @param result A PromptResult used to send back the result without blocking.
|
||||
* Defaults to cancel requests.
|
||||
*/
|
||||
@Override
|
||||
public void onPrompt(GeckoView view, GeckoView.Browser browser, String message, String defaultValue, GeckoView.PromptResult result) {
|
||||
result.cancel();
|
||||
}
|
||||
@ -55,6 +59,7 @@ public class GeckoViewChrome implements GeckoView.ChromeDelegate {
|
||||
* @param result A PromptResult used to send back the result without blocking.
|
||||
* Defaults to cancel requests.
|
||||
*/
|
||||
@Override
|
||||
public void onDebugRequest(GeckoView view, GeckoView.PromptResult result) {
|
||||
result.cancel();
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ public class GeckoViewContent implements GeckoView.ContentDelegate {
|
||||
* @param browser The Browser that is loading the content.
|
||||
* @param url The resource being loaded.
|
||||
*/
|
||||
@Override
|
||||
public void onPageStart(GeckoView view, GeckoView.Browser browser, String url) {}
|
||||
|
||||
/**
|
||||
@ -20,6 +21,7 @@ public class GeckoViewContent implements GeckoView.ContentDelegate {
|
||||
* @param browser The Browser that was loading the content.
|
||||
* @param success Whether the page loaded successfully or an error occured.
|
||||
*/
|
||||
@Override
|
||||
public void onPageStop(GeckoView view, GeckoView.Browser browser, boolean success) {}
|
||||
|
||||
/**
|
||||
@ -28,6 +30,7 @@ public class GeckoViewContent implements GeckoView.ContentDelegate {
|
||||
* @param view The GeckoView that initiated the callback.
|
||||
* @param browser The Browser that is showing the content.
|
||||
*/
|
||||
@Override
|
||||
public void onPageShow(GeckoView view, GeckoView.Browser browser) {}
|
||||
|
||||
/**
|
||||
@ -37,6 +40,7 @@ public class GeckoViewContent implements GeckoView.ContentDelegate {
|
||||
* @param browser The Browser that is showing the content.
|
||||
* @param title The title sent from the content.
|
||||
*/
|
||||
@Override
|
||||
public void onReceivedTitle(GeckoView view, GeckoView.Browser browser, String title) {}
|
||||
|
||||
/**
|
||||
@ -47,5 +51,6 @@ public class GeckoViewContent implements GeckoView.ContentDelegate {
|
||||
* @param url The href of the link element specifying the favicon.
|
||||
* @param size The maximum size specified for the favicon, or -1 for any size.
|
||||
*/
|
||||
@Override
|
||||
public void onReceivedFavicon(GeckoView view, GeckoView.Browser browser, String url, int size) {}
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ public class LightweightTheme implements GeckoEventListener {
|
||||
curView = (View) parent;
|
||||
}
|
||||
|
||||
} while(parent instanceof View && parent != null);
|
||||
} while(parent instanceof View);
|
||||
|
||||
// Adjust the coordinates for the offset.
|
||||
left -= offsetX;
|
||||
|
@ -162,7 +162,7 @@ public class NotificationHandler {
|
||||
* @return whether the notification is an AlertNotification showing progress.
|
||||
*/
|
||||
private boolean isProgressStyle(Notification notification) {
|
||||
if (notification != null && notification instanceof AlertNotification) {
|
||||
if (notification instanceof AlertNotification) {
|
||||
return ((AlertNotification)notification).isProgressStyle();
|
||||
}
|
||||
return false;
|
||||
|
@ -112,6 +112,7 @@ public class RemoteClientsDialogFragment extends DialogFragment {
|
||||
});
|
||||
} else {
|
||||
builder.setItems(clientNames, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int index) {
|
||||
final ArrayList<RemoteClient> checked = new ArrayList<RemoteClient>();
|
||||
checked.add(clients.get(index));
|
||||
|
@ -277,6 +277,7 @@ class TextSelection extends Layer implements GeckoEventListener {
|
||||
menuitem.setShowAsAction(actionEnum, R.attr.menuItemActionModeStyle);
|
||||
|
||||
BitmapUtils.getDrawable(mStartHandle.getContext(), obj.optString("icon"), new BitmapLoader() {
|
||||
@Override
|
||||
public void onBitmapFound(Drawable d) {
|
||||
if (d != null) {
|
||||
menuitem.setIcon(d);
|
||||
@ -290,11 +291,13 @@ class TextSelection extends Layer implements GeckoEventListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateActionMode(ActionModeCompat mode, Menu menu) {
|
||||
mActionMode = mode;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActionItemClicked(ActionModeCompat mode, MenuItem item) {
|
||||
try {
|
||||
final JSONObject obj = mItems.getJSONObject(item.getItemId());
|
||||
@ -307,6 +310,7 @@ class TextSelection extends Layer implements GeckoEventListener {
|
||||
}
|
||||
|
||||
// Called when the user exits the action mode
|
||||
@Override
|
||||
public void onDestroyActionMode(ActionModeCompat mode) {
|
||||
mActionMode = null;
|
||||
mCallback = null;
|
||||
|
@ -42,7 +42,7 @@ public class AndroidLevelCachingLogWriter extends LogWriter {
|
||||
private boolean shouldLogError(String logTag) {
|
||||
Boolean out = isErrorLoggable.get(logTag);
|
||||
if (out != null) {
|
||||
return out.booleanValue();
|
||||
return out;
|
||||
}
|
||||
out = Log.isLoggable(logTag, Log.ERROR);
|
||||
isErrorLoggable.put(logTag, out);
|
||||
@ -52,7 +52,7 @@ public class AndroidLevelCachingLogWriter extends LogWriter {
|
||||
private boolean shouldLogWarn(String logTag) {
|
||||
Boolean out = isWarnLoggable.get(logTag);
|
||||
if (out != null) {
|
||||
return out.booleanValue();
|
||||
return out;
|
||||
}
|
||||
out = Log.isLoggable(logTag, Log.WARN);
|
||||
isWarnLoggable.put(logTag, out);
|
||||
@ -62,7 +62,7 @@ public class AndroidLevelCachingLogWriter extends LogWriter {
|
||||
private boolean shouldLogInfo(String logTag) {
|
||||
Boolean out = isInfoLoggable.get(logTag);
|
||||
if (out != null) {
|
||||
return out.booleanValue();
|
||||
return out;
|
||||
}
|
||||
out = Log.isLoggable(logTag, Log.INFO);
|
||||
isInfoLoggable.put(logTag, out);
|
||||
@ -72,7 +72,7 @@ public class AndroidLevelCachingLogWriter extends LogWriter {
|
||||
private boolean shouldLogDebug(String logTag) {
|
||||
Boolean out = isDebugLoggable.get(logTag);
|
||||
if (out != null) {
|
||||
return out.booleanValue();
|
||||
return out;
|
||||
}
|
||||
out = Log.isLoggable(logTag, Log.DEBUG);
|
||||
isDebugLoggable.put(logTag, out);
|
||||
@ -83,43 +83,49 @@ public class AndroidLevelCachingLogWriter extends LogWriter {
|
||||
public boolean shouldLogVerbose(String logTag) {
|
||||
Boolean out = isVerboseLoggable.get(logTag);
|
||||
if (out != null) {
|
||||
return out.booleanValue();
|
||||
return out;
|
||||
}
|
||||
out = Log.isLoggable(logTag, Log.VERBOSE);
|
||||
isVerboseLoggable.put(logTag, out);
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String tag, String message, Throwable error) {
|
||||
if (shouldLogError(tag)) {
|
||||
inner.error(tag, message, error);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warn(String tag, String message, Throwable error) {
|
||||
if (shouldLogWarn(tag)) {
|
||||
inner.warn(tag, message, error);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(String tag, String message, Throwable error) {
|
||||
if (shouldLogInfo(tag)) {
|
||||
inner.info(tag, message, error);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String tag, String message, Throwable error) {
|
||||
if (shouldLogDebug(tag)) {
|
||||
inner.debug(tag, message, error);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(String tag, String message, Throwable error) {
|
||||
if (shouldLogVerbose(tag)) {
|
||||
inner.trace(tag, message, error);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
inner.close();
|
||||
}
|
||||
|
@ -15,26 +15,32 @@ public class AndroidLogWriter extends LogWriter {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String tag, String message, Throwable error) {
|
||||
Log.e(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warn(String tag, String message, Throwable error) {
|
||||
Log.w(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(String tag, String message, Throwable error) {
|
||||
Log.i(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String tag, String message, Throwable error) {
|
||||
Log.d(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(String tag, String message, Throwable error) {
|
||||
Log.v(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ public class LevelFilteringLogWriter extends LogWriter {
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
inner.close();
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ public class PrintLogWriter extends LogWriter {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (closed) {
|
||||
return;
|
||||
|
@ -14,6 +14,7 @@ public class SimpleTagLogWriter extends TagLogWriter {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMainTag() {
|
||||
return tag;
|
||||
}
|
||||
|
@ -25,26 +25,32 @@ public class StringLogWriter extends LogWriter {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String tag, String message, Throwable error) {
|
||||
inner.error(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warn(String tag, String message, Throwable error) {
|
||||
inner.warn(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(String tag, String message, Throwable error) {
|
||||
inner.info(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String tag, String message, Throwable error) {
|
||||
inner.debug(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(String tag, String message, Throwable error) {
|
||||
inner.trace(tag, message, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
inner.close();
|
||||
}
|
||||
|
@ -91,6 +91,6 @@ public class FxAccountAgeLockoutHelper {
|
||||
FxAccountConstants.pii(LOG_TAG, "Passed age check: year text was found in item list but was not a number.");
|
||||
return true;
|
||||
}
|
||||
return passesAgeCheck(yearOfBirth.intValue());
|
||||
return passesAgeCheck(yearOfBirth);
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public class FxAccountClient20 extends FxAccountClient10 implements FxAccountCli
|
||||
boolean verified = false; // In production, we're definitely not verified immediately upon creation.
|
||||
Boolean tempVerified = body.getBoolean(JSON_KEY_VERIFIED);
|
||||
if (tempVerified != null) {
|
||||
verified = tempVerified.booleanValue();
|
||||
verified = tempVerified;
|
||||
}
|
||||
byte[] sessionToken = Utils.hex2Byte(body.getString(JSON_KEY_SESSIONTOKEN));
|
||||
byte[] keyFetchToken = null;
|
||||
@ -154,10 +154,8 @@ public class FxAccountClient20 extends FxAccountClient10 implements FxAccountCli
|
||||
LoginResponse loginResponse = new LoginResponse(new String(emailUTF8, "UTF-8"), uid, verified, sessionToken, keyFetchToken);
|
||||
|
||||
delegate.handleSuccess(loginResponse);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
delegate.handleError(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -172,7 +170,6 @@ public class FxAccountClient20 extends FxAccountClient10 implements FxAccountCli
|
||||
createAccount(emailUTF8, quickStretchedPW, true, false, "sync", delegate);
|
||||
} catch (Exception e) {
|
||||
invokeHandleError(delegate, e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ public class QuickPasswordStretcher implements PasswordStretcher {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized byte[] getQuickStretchedPW(byte[] emailUTF8) throws UnsupportedEncodingException, GeneralSecurityException {
|
||||
if (emailUTF8 == null) {
|
||||
throw new IllegalArgumentException("emailUTF8 must not be null");
|
||||
|
@ -1197,7 +1197,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
|
||||
@Override
|
||||
public void recordDailyLast(int env, int day, int field, int value) {
|
||||
this.recordDailyLast(env, day, field, Integer.valueOf(value), EVENTS_INTEGER);
|
||||
this.recordDailyLast(env, day, field, value, EVENTS_INTEGER);
|
||||
}
|
||||
|
||||
private void recordDailyDiscrete(int env, int day, int field, Object value, String table) {
|
||||
@ -1371,10 +1371,12 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
"date, environment, measurement_name, measurement_version, field_name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEventCount() {
|
||||
return getRowCount("events");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentCount() {
|
||||
return getRowCount("environments");
|
||||
}
|
||||
@ -1394,6 +1396,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
* @param curEnv The ID of the current environment.
|
||||
* @return The number of environments and addon entries deleted.
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataBefore(final long time, final int curEnv) {
|
||||
final SQLiteDatabase db = this.helper.getWritableDatabase();
|
||||
db.beginTransaction();
|
||||
@ -1598,6 +1601,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
* Prunes the given number of least-recently used environments. Note that orphaned environments
|
||||
* are not removed and the environment cache is cleared.
|
||||
*/
|
||||
@Override
|
||||
public void pruneEnvironments(final int numToPrune) {
|
||||
final SQLiteDatabase db = this.helper.getWritableDatabase();
|
||||
db.beginTransaction();
|
||||
@ -1625,6 +1629,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
* events reaches the given maximum. Note that this technicality means this method cannot be
|
||||
* used to delete all events.
|
||||
*/
|
||||
@Override
|
||||
public void pruneEvents(final int maxNumToPrune) {
|
||||
final SQLiteDatabase db = this.helper.getWritableDatabase();
|
||||
|
||||
|
@ -189,7 +189,7 @@ public class HealthReportProvider extends ContentProvider {
|
||||
Object object = values.get("value");
|
||||
if (object instanceof Integer ||
|
||||
object instanceof Long) {
|
||||
storage.recordDailyLast(env, day, field.getID(), ((Integer) object).intValue());
|
||||
storage.recordDailyLast(env, day, field.getID(), (Integer) object);
|
||||
} else if (object instanceof String) {
|
||||
storage.recordDailyLast(env, day, field.getID(), (String) object);
|
||||
} else {
|
||||
@ -287,7 +287,7 @@ public class HealthReportProvider extends ContentProvider {
|
||||
private MeasurementFields getFieldSpecs(ContentValues values) {
|
||||
final ArrayList<FieldSpec> specs = new ArrayList<FieldSpec>(values.size());
|
||||
for (Entry<String, Object> entry : values.valueSet()) {
|
||||
specs.add(new FieldSpec(entry.getKey(), ((Integer) entry.getValue()).intValue()));
|
||||
specs.add(new FieldSpec(entry.getKey(), (Integer) entry.getValue()));
|
||||
}
|
||||
|
||||
return new MeasurementFields() {
|
||||
|
@ -41,10 +41,12 @@ public class PrunePolicyDatabaseStorage implements PrunePolicyStorage {
|
||||
this.currentEnvironmentID = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pruneEvents(final int count) {
|
||||
getStorage().pruneEvents(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pruneEnvironments(final int count) {
|
||||
getStorage().pruneEnvironments(count);
|
||||
|
||||
@ -59,10 +61,12 @@ public class PrunePolicyDatabaseStorage implements PrunePolicyStorage {
|
||||
* current environment from the profile cache, it will not delete data so be sure to prune by
|
||||
* other methods (e.g. {@link pruneEvents}) as well.
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataBefore(final long time) {
|
||||
return getStorage().deleteDataBefore(time, getCurrentEnvironmentID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
final HealthReportDatabaseStorage storage = getStorage();
|
||||
// The change to auto_vacuum will only take affect after a vacuum.
|
||||
@ -70,14 +74,17 @@ public class PrunePolicyDatabaseStorage implements PrunePolicyStorage {
|
||||
storage.vacuum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEventCount() {
|
||||
return getStorage().getEventCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentCount() {
|
||||
return getStorage().getEnvironmentCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (client != null) {
|
||||
client.release();
|
||||
|
@ -131,13 +131,13 @@ public class ObsoleteDocumentTracker {
|
||||
public int compare(Entry<String, Object> lhs, Entry<String, Object> rhs) {
|
||||
Object l = lhs.getValue();
|
||||
Object r = rhs.getValue();
|
||||
if (l == null || !(l instanceof Long)) {
|
||||
if (r == null || !(r instanceof Long)) {
|
||||
if (!(l instanceof Long)) {
|
||||
if (!(r instanceof Long)) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (r == null || !(r instanceof Long)) {
|
||||
if (!(r instanceof Long)) {
|
||||
return 1;
|
||||
}
|
||||
return ((Long) r).compareTo((Long) l);
|
||||
@ -236,7 +236,7 @@ public class ObsoleteDocumentTracker {
|
||||
if (!(o instanceof Long)) {
|
||||
continue;
|
||||
}
|
||||
if (((Long) o).longValue() > HealthReportConstants.DELETION_ATTEMPTS_PER_OBSOLETE_DOCUMENT_ID) {
|
||||
if ((Long) o > HealthReportConstants.DELETION_ATTEMPTS_PER_OBSOLETE_DOCUMENT_ID) {
|
||||
ids.put(key, HealthReportConstants.DELETION_ATTEMPTS_PER_OBSOLETE_DOCUMENT_ID);
|
||||
}
|
||||
}
|
||||
|
@ -32,200 +32,195 @@ import android.util.Log;
|
||||
|
||||
public class PreferenceManagerCompat {
|
||||
|
||||
private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
|
||||
private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* Interface definition for a callback to be invoked when a {@link Preference} in the hierarchy
|
||||
* rooted at this {@link PreferenceScreen} is clicked.
|
||||
*/
|
||||
interface OnPreferenceTreeClickListener {
|
||||
/**
|
||||
* Interface definition for a callback to be invoked when a
|
||||
* {@link Preference} in the hierarchy rooted at this {@link PreferenceScreen} is
|
||||
* Called when a preference in the tree rooted at this {@link PreferenceScreen} has been
|
||||
* clicked.
|
||||
*/
|
||||
interface OnPreferenceTreeClickListener {
|
||||
/**
|
||||
* Called when a preference in the tree rooted at this
|
||||
* {@link PreferenceScreen} has been clicked.
|
||||
*
|
||||
* @param preferenceScreen The {@link PreferenceScreen} that the
|
||||
* preference is located in.
|
||||
* @param preference The preference that was clicked.
|
||||
* @return Whether the click was handled.
|
||||
*/
|
||||
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
|
||||
}
|
||||
|
||||
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
||||
try {
|
||||
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
||||
c.setAccessible(true);
|
||||
return c.newInstance(activity, firstRequestCode);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the owning preference fragment
|
||||
*/
|
||||
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
|
||||
// stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callback to be invoked when a {@link Preference} in the
|
||||
* hierarchy rooted at this {@link PreferenceManager} is clicked.
|
||||
*
|
||||
* @param listener The callback to be invoked.
|
||||
* @param preferenceScreen The {@link PreferenceScreen} that the preference is located in.
|
||||
* @param preference The preference that was clicked.
|
||||
*
|
||||
* @return Whether the click was handled.
|
||||
*/
|
||||
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
||||
try {
|
||||
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
||||
onPreferenceTreeClickListener.setAccessible(true);
|
||||
if (listener != null) {
|
||||
Object proxy = Proxy.newProxyInstance(
|
||||
onPreferenceTreeClickListener.getType().getClassLoader(),
|
||||
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
||||
new InvocationHandler() {
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||
if (method.getName().equals("onPreferenceTreeClick")) {
|
||||
return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
onPreferenceTreeClickListener.set(manager, proxy);
|
||||
} else {
|
||||
onPreferenceTreeClickListener.set(manager, null);
|
||||
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
|
||||
}
|
||||
|
||||
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
||||
try {
|
||||
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
||||
c.setAccessible(true);
|
||||
return c.newInstance(activity, firstRequestCode);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the owning preference fragment
|
||||
*/
|
||||
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
|
||||
// stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callback to be invoked when a {@link Preference} in the hierarchy rooted at this
|
||||
* {@link PreferenceManager} is clicked.
|
||||
*
|
||||
* @param listener The callback to be invoked.
|
||||
*/
|
||||
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
||||
try {
|
||||
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
||||
onPreferenceTreeClickListener.setAccessible(true);
|
||||
if (listener != null) {
|
||||
Object proxy = Proxy.newProxyInstance(
|
||||
onPreferenceTreeClickListener.getType().getClassLoader(),
|
||||
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
||||
new InvocationHandler() {
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||
if (method.getName().equals("onPreferenceTreeClick")) {
|
||||
return listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
||||
}
|
||||
});
|
||||
onPreferenceTreeClickListener.set(manager, proxy);
|
||||
} else {
|
||||
onPreferenceTreeClickListener.set(manager, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inflates a preference hierarchy from the preference hierarchies of
|
||||
* {@link Activity Activities} that match the given {@link Intent}. An
|
||||
* {@link Activity} defines its preference hierarchy with meta-data using
|
||||
* the {@link #METADATA_KEY_PREFERENCES} key.
|
||||
* <p>
|
||||
* If a preference hierarchy is given, the new preference hierarchies will
|
||||
* be merged in.
|
||||
*
|
||||
* @param queryIntent The intent to match activities.
|
||||
* @param rootPreferences Optional existing hierarchy to merge the new
|
||||
* hierarchies into.
|
||||
* @return The root hierarchy (if one was not provided, the new hierarchy's
|
||||
* root).
|
||||
*/
|
||||
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
||||
}
|
||||
return null;
|
||||
/**
|
||||
* Inflates a preference hierarchy from the preference hierarchies of {@link Activity Activities}
|
||||
* that match the given {@link Intent}. An {@link Activity} defines its preference hierarchy with
|
||||
* meta-data using the {@link #METADATA_KEY_PREFERENCES} key.
|
||||
* <p/>
|
||||
* If a preference hierarchy is given, the new preference hierarchies will be merged in.
|
||||
*
|
||||
* @param queryIntent The intent to match activities.
|
||||
* @param rootPreferences Optional existing hierarchy to merge the new hierarchies into.
|
||||
*
|
||||
* @return The root hierarchy (if one was not provided, the new hierarchy's root).
|
||||
*/
|
||||
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inflates a preference hierarchy from XML. If a preference hierarchy is
|
||||
* given, the new preference hierarchies will be merged in.
|
||||
*
|
||||
* @param context The context of the resource.
|
||||
* @param resId The resource ID of the XML to inflate.
|
||||
* @param rootPreferences Optional existing hierarchy to merge the new
|
||||
* hierarchies into.
|
||||
* @return The root hierarchy (if one was not provided, the new hierarchy's
|
||||
* root).
|
||||
* @hide
|
||||
*/
|
||||
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
||||
}
|
||||
return null;
|
||||
/**
|
||||
* Inflates a preference hierarchy from XML. If a preference hierarchy is given, the new
|
||||
* preference hierarchies will be merged in.
|
||||
*
|
||||
* @param context The context of the resource.
|
||||
* @param resId The resource ID of the XML to inflate.
|
||||
* @param rootPreferences Optional existing hierarchy to merge the new hierarchies into.
|
||||
*
|
||||
* @return The root hierarchy (if one was not provided, the new hierarchy's root).
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the root of the preference hierarchy managed by this class.
|
||||
*
|
||||
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
|
||||
*/
|
||||
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
|
||||
m.setAccessible(true);
|
||||
return (PreferenceScreen) m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
||||
}
|
||||
return null;
|
||||
/**
|
||||
* Returns the root of the preference hierarchy managed by this class.
|
||||
*
|
||||
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
|
||||
*/
|
||||
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
|
||||
m.setAccessible(true);
|
||||
return (PreferenceScreen) m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
|
||||
*/
|
||||
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
|
||||
}
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
|
||||
*/
|
||||
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch the activity stop
|
||||
* event.
|
||||
*/
|
||||
static void dispatchActivityStop(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
|
||||
}
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch the activity stop event.
|
||||
*/
|
||||
static void dispatchActivityStop(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch the activity destroy
|
||||
* event.
|
||||
*/
|
||||
static void dispatchActivityDestroy(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
||||
}
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch the activity destroy event.
|
||||
*/
|
||||
static void dispatchActivityDestroy(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the root of the preference hierarchy.
|
||||
*
|
||||
* @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
|
||||
* @return Whether the {@link PreferenceScreen} given is different than the previous.
|
||||
*/
|
||||
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
return ((Boolean) m.invoke(manager, screen));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
||||
}
|
||||
return false;
|
||||
/**
|
||||
* Sets the root of the preference hierarchy.
|
||||
*
|
||||
* @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
|
||||
*
|
||||
* @return Whether the {@link PreferenceScreen} given is different than the previous.
|
||||
*/
|
||||
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
return ((Boolean) m.invoke(manager, screen));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ public class TabsProvider extends PerProfileDatabaseProvider<TabsProvider.TabsDa
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("fallthrough")
|
||||
public int deleteInTransaction(Uri uri, String selection, String[] selectionArgs) {
|
||||
trace("Calling delete in transaction on URI: " + uri);
|
||||
@ -255,6 +256,7 @@ public class TabsProvider extends PerProfileDatabaseProvider<TabsProvider.TabsDa
|
||||
return deleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insertInTransaction(Uri uri, ContentValues values) {
|
||||
trace("Calling insert in transaction on URI: " + uri);
|
||||
|
||||
@ -287,6 +289,7 @@ public class TabsProvider extends PerProfileDatabaseProvider<TabsProvider.TabsDa
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateInTransaction(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||
trace("Calling update in transaction on URI: " + uri);
|
||||
|
||||
|
@ -476,6 +476,7 @@ public class TopSitesCursorWrapper implements Cursor {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri getNotificationUri() {
|
||||
// There's no single notification URI for the wrapper
|
||||
return null;
|
||||
|
@ -84,7 +84,9 @@ public class FaviconCacheElement implements Comparable<FaviconCacheElement> {
|
||||
final int w2 = another.imageSize;
|
||||
if (w1 > w2) {
|
||||
return 1;
|
||||
} else if (w2 > w1) {
|
||||
}
|
||||
|
||||
if (w2 > w1) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -379,7 +379,7 @@ abstract public class FxAccountAbstractSetupActivity extends FxAccountAbstractAc
|
||||
}
|
||||
|
||||
// And then sorted in alphabetical order.
|
||||
final String[] sortedEmails = emails.toArray(new String[0]);
|
||||
final String[] sortedEmails = emails.toArray(new String[emails.size()]);
|
||||
Arrays.sort(sortedEmails);
|
||||
|
||||
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, sortedEmails);
|
||||
|
@ -176,7 +176,7 @@ public class FxAccountCreateAccountActivity extends FxAccountAbstractSetupActivi
|
||||
for (int i = 1991; i <= year - 5; i++) {
|
||||
years.add(Integer.toString(i));
|
||||
}
|
||||
return years.toArray(new String[0]);
|
||||
return years.toArray(new String[years.size()]);
|
||||
}
|
||||
|
||||
protected void createYearEdit() {
|
||||
|
@ -171,7 +171,9 @@ public class FxAccountStatusActivity extends LocaleAwareFragmentActivity {
|
||||
if (itemId == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
} else if (itemId == R.id.remove_account) {
|
||||
}
|
||||
|
||||
if (itemId == R.id.remove_account) {
|
||||
maybeDeleteAndroidAccount(FirefoxAccounts.getFirefoxAccount(this));
|
||||
return true;
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ public class AccountPickler {
|
||||
|
||||
public static ExtendedJSONObject toJSON(final AndroidFxAccount account, final long now) {
|
||||
final ExtendedJSONObject o = new ExtendedJSONObject();
|
||||
o.put(KEY_PICKLE_VERSION, Long.valueOf(PICKLE_VERSION));
|
||||
o.put(KEY_PICKLE_TIMESTAMP, Long.valueOf(now));
|
||||
o.put(KEY_PICKLE_VERSION, PICKLE_VERSION);
|
||||
o.put(KEY_PICKLE_TIMESTAMP, now);
|
||||
|
||||
o.put(KEY_ACCOUNT_VERSION, AndroidFxAccount.CURRENT_ACCOUNT_VERSION);
|
||||
o.put(KEY_ACCOUNT_TYPE, FxAccountConstants.ACCOUNT_TYPE);
|
||||
@ -188,7 +188,7 @@ public class AccountPickler {
|
||||
Long timestamp = json.getLong(KEY_PICKLE_TIMESTAMP);
|
||||
if (timestamp == null) {
|
||||
Logger.warn(LOG_TAG, "Did not find timestamp in pickle file; ignoring.");
|
||||
timestamp = Long.valueOf(-1);
|
||||
timestamp = -1L;
|
||||
}
|
||||
|
||||
Logger.info(LOG_TAG, "Un-pickled Android account named " + params.email + " (version " +
|
||||
|
@ -63,8 +63,7 @@ public class AndroidFxAccount {
|
||||
public static final String BUNDLE_KEY_STATE_LABEL = "stateLabel";
|
||||
public static final String BUNDLE_KEY_STATE = "state";
|
||||
|
||||
protected static final List<String> ANDROID_AUTHORITIES = Collections.unmodifiableList(Arrays.asList(
|
||||
new String[] { BrowserContract.AUTHORITY }));
|
||||
protected static final List<String> ANDROID_AUTHORITIES = Collections.unmodifiableList(Arrays.asList(BrowserContract.AUTHORITY));
|
||||
|
||||
protected final Context context;
|
||||
protected final AccountManager accountManager;
|
||||
@ -170,7 +169,7 @@ public class AndroidFxAccount {
|
||||
if (b == null) {
|
||||
return def;
|
||||
}
|
||||
return b.booleanValue();
|
||||
return b;
|
||||
}
|
||||
|
||||
protected byte[] getBundleDataBytes(String key) {
|
||||
|
@ -144,6 +144,7 @@ public final class BitmapUtils {
|
||||
final Tab tab = Tabs.getInstance().getTab(id);
|
||||
runOnBitmapFoundOnUiThread(loader, tab.getThumbnail());
|
||||
Tabs.registerOnTabsChangedListener(new Tabs.OnTabsChangedListener() {
|
||||
@Override
|
||||
public void onTabChanged(Tab t, Tabs.TabEvents msg, Object data) {
|
||||
if (tab == t && msg == Tabs.TabEvents.THUMBNAIL) {
|
||||
Tabs.unregisterOnTabsChangedListener(this);
|
||||
|
@ -32,6 +32,7 @@ class NativePanZoomController implements PanZoomController, GeckoEventListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(String event, JSONObject message) {
|
||||
if ("Gecko:Ready".equals(event)) {
|
||||
mDispatcher.unregisterGeckoThreadListener(this, "Gecko:Ready");
|
||||
@ -39,49 +40,61 @@ class NativePanZoomController implements PanZoomController, GeckoEventListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
GeckoEvent wrapped = GeckoEvent.createMotionEvent(event, true);
|
||||
return handleTouchEvent(wrapped);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMotionEvent(MotionEvent event) {
|
||||
// FIXME implement this
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyEvent(KeyEvent event) {
|
||||
// FIXME implement this
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointF getVelocityVector() {
|
||||
// FIXME implement this
|
||||
return new PointF(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pageRectUpdated() {
|
||||
// no-op in APZC, I think
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abortPanning() {
|
||||
// no-op in APZC, I think
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyDefaultActionPrevented(boolean prevented) {
|
||||
// This should never get called; there is a different
|
||||
// codepath that notifies the APZ code of this.
|
||||
throw new IllegalStateException("APZCCallbackHandler::NotifyDefaultPrevented should be getting called, not this!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public native void abortAnimation();
|
||||
|
||||
private native void init();
|
||||
private native boolean handleTouchEvent(GeckoEvent event);
|
||||
private native void handleMotionEvent(GeckoEvent event);
|
||||
|
||||
@Override
|
||||
public native void destroy();
|
||||
@Override
|
||||
public native boolean getRedrawHint();
|
||||
@Override
|
||||
public native void setOverScrollMode(int overscrollMode);
|
||||
@Override
|
||||
public native int getOverScrollMode();
|
||||
|
||||
@WrapElementForJNI(allowMultithread = true, stubName = "RequestContentRepaintWrapper")
|
||||
@ -89,6 +102,7 @@ class NativePanZoomController implements PanZoomController, GeckoEventListener {
|
||||
mTarget.forceRedraw(new DisplayPortMetrics(x, y, x + width, y + height, resolution));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOverscrollHandler(final Overscroll listener) {
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public class OverscrollEdgeEffect implements Overscroll {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(final int width, final int height) {
|
||||
mEdges[LEFT].setSize(height, width);
|
||||
mEdges[RIGHT].setSize(height, width);
|
||||
@ -65,6 +66,7 @@ public class OverscrollEdgeEffect implements Overscroll {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVelocity(final float velocity, final Axis axis) {
|
||||
final EdgeEffect edge = getEdgeForAxisAndSide(axis, velocity);
|
||||
|
||||
@ -79,6 +81,7 @@ public class OverscrollEdgeEffect implements Overscroll {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDistance(final float distance, final Axis axis) {
|
||||
// The first overscroll event often has zero distance. Throw it out
|
||||
if (distance == 0.0f) {
|
||||
@ -90,6 +93,7 @@ public class OverscrollEdgeEffect implements Overscroll {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(final Canvas canvas, final ImmutableViewportMetrics metrics) {
|
||||
if (metrics == null) {
|
||||
return;
|
||||
|
@ -101,16 +101,19 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
private final SessionInformation previousSession;
|
||||
private volatile SessionInformation session;
|
||||
|
||||
@Override
|
||||
public void setCurrentSession(SessionInformation session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordGeckoStartupTime(long duration) {
|
||||
if (this.session == null) {
|
||||
return;
|
||||
}
|
||||
this.session.setTimedGeckoStartup(duration);
|
||||
}
|
||||
@Override
|
||||
public void recordJavaStartupTime(long duration) {
|
||||
if (this.session == null) {
|
||||
return;
|
||||
@ -164,6 +167,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
this.prefs = appPrefs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
@ -172,6 +176,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
* Shut down database connections, unregister event listeners, and perform
|
||||
* provider-specific uninitialization.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
switch (this.state) {
|
||||
case CLOSED:
|
||||
@ -208,12 +213,14 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
EVENT_SEARCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppLocaleChanged(String to) {
|
||||
Log.d(LOG_TAG, "Setting health recorder app locale to " + to);
|
||||
this.profileCache.beginInitialization();
|
||||
this.profileCache.setAppLocale(to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddonChanged(String id, JSONObject json) {
|
||||
this.profileCache.beginInitialization();
|
||||
try {
|
||||
@ -223,6 +230,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddonUninstalling(String id) {
|
||||
this.profileCache.beginInitialization();
|
||||
try {
|
||||
@ -243,6 +251,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
* #onEnvironmentTransition(int, int, boolean, String)} will be invoked on the background
|
||||
* thread.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void onEnvironmentChanged() {
|
||||
onEnvironmentChanged(true, "E");
|
||||
}
|
||||
@ -252,6 +261,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
* (e.g., because we're about to restart, and we don't want to create
|
||||
* an orphan).
|
||||
*/
|
||||
@Override
|
||||
public synchronized void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) {
|
||||
final int previousEnv = this.env;
|
||||
this.env = -1;
|
||||
@ -685,6 +695,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
* @param engineID the string identifier for the engine. Can be <code>null</code>.
|
||||
* @param location one of a fixed set of locations: see {@link #SEARCH_LOCATIONS}.
|
||||
*/
|
||||
@Override
|
||||
public void recordSearch(final String engineID, final String location) {
|
||||
if (this.state != State.INITIALIZED) {
|
||||
Log.d(LOG_TAG, "Not initialized: not recording search. (" + this.state + ")");
|
||||
@ -824,6 +835,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkForOrphanSessions() {
|
||||
if (!this.orphanChecked.compareAndSet(false, true)) {
|
||||
Log.w(LOG_TAG, "Attempting to check for orphan sessions more than once.");
|
||||
@ -854,6 +866,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordSessionEnd(String reason, SharedPreferences.Editor editor) {
|
||||
recordSessionEnd(reason, editor, env);
|
||||
}
|
||||
@ -864,6 +877,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
||||
* @param environment An environment ID. This allows callers to record the
|
||||
* end of a session due to an observed environment change.
|
||||
*/
|
||||
@Override
|
||||
public void recordSessionEnd(String reason, SharedPreferences.Editor editor, final int environment) {
|
||||
Log.d(LOG_TAG, "Recording session end: " + reason);
|
||||
if (state != State.INITIALIZED) {
|
||||
|
@ -14,23 +14,37 @@ import org.json.JSONObject;
|
||||
* nothing.
|
||||
*/
|
||||
public class StubbedHealthRecorder implements HealthRecorder {
|
||||
@Override
|
||||
public boolean isEnabled() { return false; }
|
||||
|
||||
@Override
|
||||
public void setCurrentSession(SessionInformation session) { }
|
||||
@Override
|
||||
public void checkForOrphanSessions() { }
|
||||
|
||||
@Override
|
||||
public void recordGeckoStartupTime(long duration) { }
|
||||
@Override
|
||||
public void recordJavaStartupTime(long duration) { }
|
||||
@Override
|
||||
public void recordSearch(final String engineID, final String location) { }
|
||||
@Override
|
||||
public void recordSessionEnd(String reason, SharedPreferences.Editor editor) { }
|
||||
@Override
|
||||
public void recordSessionEnd(String reason, SharedPreferences.Editor editor, final int environment) { }
|
||||
|
||||
@Override
|
||||
public void onAppLocaleChanged(String to) { }
|
||||
@Override
|
||||
public void onAddonChanged(String id, JSONObject json) { }
|
||||
@Override
|
||||
public void onAddonUninstalling(String id) { }
|
||||
@Override
|
||||
public void onEnvironmentChanged() { }
|
||||
@Override
|
||||
public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) { }
|
||||
|
||||
@Override
|
||||
public void close() { }
|
||||
|
||||
@Override
|
||||
|
@ -85,10 +85,12 @@ class BookmarksListAdapter extends MultiTypeCursorAdapter {
|
||||
}
|
||||
|
||||
public static final Creator<FolderInfo> CREATOR = new Creator<FolderInfo>() {
|
||||
@Override
|
||||
public FolderInfo createFromParcel(Parcel in) {
|
||||
return new FolderInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FolderInfo[] newArray(int size) {
|
||||
return new FolderInfo[size];
|
||||
}
|
||||
|
@ -822,7 +822,9 @@ public class BrowserSearch extends HomeFragment
|
||||
|
||||
if (engine == -1) {
|
||||
return ROW_STANDARD;
|
||||
} else if (engine == 0 && mSuggestionsEnabled) {
|
||||
}
|
||||
|
||||
if (engine == 0 && mSuggestionsEnabled) {
|
||||
// Give suggestion views their own type to prevent them from
|
||||
// sharing other recycled search engine views. Using other
|
||||
// recycled views for the suggestion row can break animations
|
||||
|
@ -116,7 +116,7 @@ public abstract class HomeFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
|
||||
if (menuInfo == null || !(menuInfo instanceof HomeContextMenuInfo)) {
|
||||
if (!(menuInfo instanceof HomeContextMenuInfo)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ public abstract class HomeFragment extends Fragment {
|
||||
// between the activity and its fragments.
|
||||
|
||||
ContextMenuInfo menuInfo = item.getMenuInfo();
|
||||
if (menuInfo == null || !(menuInfo instanceof HomeContextMenuInfo)) {
|
||||
if (!(menuInfo instanceof HomeContextMenuInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -189,10 +189,12 @@ abstract class PanelLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
public static final Creator<DatasetRequest> CREATOR = new Creator<DatasetRequest>() {
|
||||
@Override
|
||||
public DatasetRequest createFromParcel(Parcel in) {
|
||||
return new DatasetRequest(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetRequest[] newArray(int size) {
|
||||
return new DatasetRequest[size];
|
||||
}
|
||||
@ -629,10 +631,12 @@ abstract class PanelLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
public static final Creator<FilterDetail> CREATOR = new Creator<FilterDetail>() {
|
||||
@Override
|
||||
public FilterDetail createFromParcel(Parcel in) {
|
||||
return new FilterDetail(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterDetail[] newArray(int size) {
|
||||
return new FilterDetail[size];
|
||||
}
|
||||
|
@ -363,6 +363,7 @@ public class RecentTabsPanel extends HomeFragment
|
||||
super(context, null, VIEW_TYPES, LAYOUT_TYPES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
final Cursor c = getCursor(position);
|
||||
final int type = c.getInt(c.getColumnIndexOrThrow(RecentTabs.TYPE));
|
||||
@ -378,6 +379,7 @@ public class RecentTabsPanel extends HomeFragment
|
||||
return ROW_STANDARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int position) {
|
||||
return (getItemViewType(position) != ROW_HEADER);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user