Bug 1301715 - BrowserApp: Receive metadata from event. r?ahunt
MozReview-Commit-ID: 7rND7R09Pj6
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -712,17 +712,18 @@ public class BrowserApp extends GeckoApp
"Favicon:CacheLoad",
"Feedback:MaybeLater",
"Menu:Add",
"Menu:Remove",
"Sanitize:ClearHistory",
"Sanitize:ClearSyncedTabs",
"Settings:Show",
"Telemetry:Gather",
- "Updater:Launch");
+ "Updater:Launch",
+ "Website:Metadata");
final GeckoProfile profile = getProfile();
// We want to upload the telemetry core ping as soon after startup as possible. It relies on the
// Distribution being initialized. If you move this initialization, ensure it plays well with telemetry.
final Distribution distribution = Distribution.init(getApplicationContext());
distribution.addOnDistributionReadyCallback(
new DistributionStoreCallback(getApplicationContext(), profile.getName()));
@@ -1453,17 +1454,18 @@ public class BrowserApp extends GeckoApp
"Favicon:CacheLoad",
"Feedback:MaybeLater",
"Menu:Add",
"Menu:Remove",
"Sanitize:ClearHistory",
"Sanitize:ClearSyncedTabs",
"Settings:Show",
"Telemetry:Gather",
- "Updater:Launch");
+ "Updater:Launch",
+ "Website:Metadata");
if (AppConstants.MOZ_ANDROID_BEAM) {
NfcAdapter nfc = NfcAdapter.getDefaultAdapter(this);
if (nfc != null) {
// null this out even though the docs say it's not needed,
// because the source code looks like it will only do this
// automatically on API 14+
nfc.setNdefPushMessageCallback(null, this);
@@ -1852,16 +1854,23 @@ public class BrowserApp extends GeckoApp
manager.enqueue(request);
Log.d(LOGTAG, "Enqueued download (Download Manager)");
} catch (RuntimeException e) {
Log.e(LOGTAG, "Download failed: " + e);
}
break;
+ case "Website:Metadata":
+ final NativeJSObject metadata = message.getObject("metadata");
+ final String location = message.getString("location");
+
+ // TODO: Store metadata (Bug 1301717)
+ break;
+
default:
super.handleMessage(event, message, callback);
break;
}
}
private void getFaviconFromCache(final EventCallback callback, final String url) {
Icons.with(this)