diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index aff2cb8dff0a..081a5c00ce69 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,13 +19,13 @@
-
-
+
+
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 2dc0b10b379c..717cd3e1f87f 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,10 +17,10 @@
-
-
+
+
-
+
@@ -128,7 +128,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 1606d1e2ebd9..186773001fae 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,15 +15,15 @@
-
+
-
+
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index aff2cb8dff0a..081a5c00ce69 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,13 +19,13 @@
-
-
+
+
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 4a538c0e2c78..95231a68e89c 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,10 +17,10 @@
-
-
+
+
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index e7a0e56e13e7..d463fc886e52 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "387f4c0123a7e82eae4c83f88f73e81f907c00e2",
+ "revision": "aba00cfd579caaf205e05c269f0a8100f242f39c",
"repo_path": "/integration/gaia-central"
}
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index a523fba4f46e..19783da844ec 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,12 +17,12 @@
-
-
+
+
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 6df832fef0f5..de8a57da2cec 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,8 +15,8 @@
-
-
+
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 51213e7e1fb4..ed3ca81f87c7 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,10 +17,10 @@
-
-
+
+
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 737c8b280696..e21ac3690f40 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,12 +17,12 @@
-
-
+
+
-
+
diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml
index 91763d377c8a..87367d75458d 100644
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -1,5 +1,5 @@
-
+
@@ -88,6 +88,12 @@
+
+
+
+
+
+
@@ -304,10 +310,8 @@
-
-
-
-
+
+
@@ -365,8 +369,8 @@
-
-
+
+
@@ -697,7 +701,7 @@
-
+
@@ -713,6 +717,12 @@
+
+
+
+
+
+
@@ -1211,8 +1221,10 @@
-
-
+
+
+
+
@@ -1507,6 +1519,12 @@
+
+
+
+
+
+
diff --git a/browser/components/preferences/content.js b/browser/components/preferences/content.js
index 6f21d68e3073..c0aee4b0392f 100644
--- a/browser/components/preferences/content.js
+++ b/browser/components/preferences/content.js
@@ -188,5 +188,11 @@ var gContentPane = {
document.documentElement.openWindow("Browser:TranslationExceptions",
"chrome://browser/content/preferences/translation.xul",
"", null);
+ },
+
+ openTranslationProviderAttribution: function ()
+ {
+ Components.utils.import("resource:///modules/translation/Translation.jsm");
+ Translation.openProviderAttribution();
}
};
diff --git a/browser/components/preferences/content.xul b/browser/components/preferences/content.xul
index d4f9a4eb5396..89ad253a4e80 100644
--- a/browser/components/preferences/content.xul
+++ b/browser/components/preferences/content.xul
@@ -144,10 +144,16 @@
oncommand="gContentPane.showLanguages();"/>
-
+
+
+
+
+
diff --git a/browser/components/preferences/in-content/content.js b/browser/components/preferences/in-content/content.js
index 86acbd7f8e5d..86c65a457f13 100644
--- a/browser/components/preferences/in-content/content.js
+++ b/browser/components/preferences/in-content/content.js
@@ -186,5 +186,11 @@ var gContentPane = {
{
openDialog("chrome://browser/content/preferences/translation.xul",
"Browser:TranslationExceptions", null);
+ },
+
+ openTranslationProviderAttribution: function ()
+ {
+ Components.utils.import("resource:///modules/translation/Translation.jsm");
+ Translation.openProviderAttribution();
}
};
diff --git a/browser/components/preferences/in-content/content.xul b/browser/components/preferences/in-content/content.xul
index d3f1dc8c70df..47d56c1720e8 100644
--- a/browser/components/preferences/in-content/content.xul
+++ b/browser/components/preferences/in-content/content.xul
@@ -134,10 +134,17 @@
-
+
+
+
+
+
+
diff --git a/browser/components/translation/Translation.jsm b/browser/components/translation/Translation.jsm
index bb3c4411f628..136f73797b21 100644
--- a/browser/components/translation/Translation.jsm
+++ b/browser/components/translation/Translation.jsm
@@ -80,6 +80,12 @@ this.Translation = {
if (trUI.shouldShowInfoBar(aBrowser.currentURI))
trUI.showTranslationInfoBar();
+ },
+
+ openProviderAttribution: function() {
+ Cu.import("resource:///modules/RecentWindow.jsm");
+ RecentWindow.getMostRecentBrowserWindow().openUILinkIn(
+ "http://aka.ms/MicrosoftTranslatorAttribution", "tab");
}
};
@@ -305,6 +311,13 @@ let TranslationHealthReport = {
this._withProvider(provider => provider.recordLanguageChange(beforeFirstTranslation));
},
+ /**
+ * Record a denied translation offer.
+ */
+ recordDeniedTranslationOffer: function () {
+ this._withProvider(provider => provider.recordDeniedTranslationOffer());
+ },
+
/**
* Retrieve the translation provider and pass it to the given function.
*
@@ -363,6 +376,7 @@ TranslationMeasurement1.prototype = Object.freeze({
pageTranslatedCountsByLanguage: DAILY_LAST_TEXT_FIELD,
detectedLanguageChangedBefore: DAILY_COUNTER_FIELD,
detectedLanguageChangedAfter: DAILY_COUNTER_FIELD,
+ deniedTranslationOffer: DAILY_COUNTER_FIELD,
detectLanguageEnabled: DAILY_LAST_NUMERIC_FIELD,
showTranslationUI: DAILY_LAST_NUMERIC_FIELD,
},
@@ -499,6 +513,15 @@ TranslationProvider.prototype = Object.freeze({
}.bind(this));
},
+ recordDeniedTranslationOffer: function () {
+ let m = this.getMeasurement(TranslationMeasurement1.prototype.name,
+ TranslationMeasurement1.prototype.version);
+
+ return this._enqueueTelemetryStorageTask(function* recordTask() {
+ yield m.incrementDailyCounter("deniedTranslationOffer");
+ }.bind(this));
+ },
+
collectDailyData: function () {
let m = this.getMeasurement(TranslationMeasurement1.prototype.name,
TranslationMeasurement1.prototype.version);
diff --git a/browser/components/translation/jar.mn b/browser/components/translation/jar.mn
index c5e322ffcd61..be744cb9ef12 100644
--- a/browser/components/translation/jar.mn
+++ b/browser/components/translation/jar.mn
@@ -3,3 +3,4 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/translation-infobar.xml
+ content/browser/microsoft-translator-attribution.png
diff --git a/browser/components/translation/microsoft-translator-attribution.png b/browser/components/translation/microsoft-translator-attribution.png
new file mode 100644
index 000000000000..d9d277461b4b
Binary files /dev/null and b/browser/components/translation/microsoft-translator-attribution.png differ
diff --git a/browser/components/translation/test/unit/test_healthreport.js b/browser/components/translation/test/unit/test_healthreport.js
index 6703c939aeb3..eed8a851d1d4 100644
--- a/browser/components/translation/test/unit/test_healthreport.js
+++ b/browser/components/translation/test/unit/test_healthreport.js
@@ -196,6 +196,28 @@ add_task(function* test_record_translation() {
yield storage.close();
});
+add_task(function* test_denied_translation_offer() {
+ let storage = yield Metrics.Storage("translation");
+ let provider = new TranslationProvider();
+ yield provider.init(storage);
+ let now = new Date();
+
+ yield provider.recordDeniedTranslationOffer();
+ yield provider.recordDeniedTranslationOffer();
+
+ let m = provider.getMeasurement("translation", 1);
+ let values = yield m.getValues();
+ Assert.equal(values.days.size, 1);
+ Assert.ok(values.days.hasDay(now));
+ let day = values.days.getDay(now);
+
+ Assert.ok(day.has("deniedTranslationOffer"));
+ Assert.equal(day.get("deniedTranslationOffer"), 2);
+
+ yield provider.shutdown();
+ yield storage.close();
+});
+
add_task(function* test_collect_daily() {
let storage = yield Metrics.Storage("translation");
let provider = new TranslationProvider();
@@ -253,6 +275,8 @@ add_task(function* test_healthreporter_json() {
yield provider.recordTranslationOpportunity("es", now);
yield provider.recordTranslation("es", "en", 1000, now);
+ yield provider.recordDeniedTranslationOffer();
+
yield reporter.collectMeasurements();
let payload = yield reporter.getJSONPayload(true);
let today = reporter._formatDate(now);
@@ -285,6 +309,9 @@ add_task(function* test_healthreporter_json() {
Assert.equal(translations["detectedLanguageChangedBefore"], 1);
Assert.ok("detectedLanguageChangedAfter" in translations);
Assert.equal(translations["detectedLanguageChangedAfter"], 1);
+
+ Assert.ok("deniedTranslationOffer" in translations);
+ Assert.equal(translations["deniedTranslationOffer"], 1);
} finally {
reporter._shutdown();
}
@@ -309,6 +336,8 @@ add_task(function* test_healthreporter_json2() {
yield provider.recordTranslationOpportunity("es", now);
yield provider.recordTranslation("es", "en", 1000, now);
+ yield provider.recordDeniedTranslationOffer();
+
yield reporter.collectMeasurements();
let payload = yield reporter.getJSONPayload(true);
let today = reporter._formatDate(now);
@@ -327,6 +356,7 @@ add_task(function* test_healthreporter_json2() {
Assert.ok(!("pageTranslatedCountsByLanguage" in translations));
Assert.ok(!("detectedLanguageChangedBefore" in translations));
Assert.ok(!("detectedLanguageChangedAfter" in translations));
+ Assert.ok(!("deniedTranslationOffer" in translations));
} finally {
reporter._shutdown();
}
diff --git a/browser/components/translation/translation-infobar.xml b/browser/components/translation/translation-infobar.xml
index 585bc3224401..b9d89512612a 100644
--- a/browser/components/translation/translation-infobar.xml
+++ b/browser/components/translation/translation-infobar.xml
@@ -98,7 +98,9 @@
class="translate-infobar-element options-menu-button"
anonid="options"
label="&translation.options.menu;">
-
+
@@ -310,6 +318,14 @@