Bug 1267639 - (Pre) Add onNewIntent() method to BrowserAppDelegate. r=grisha
MozReview-Commit-ID: KGBLTTPwVV1
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -3834,16 +3834,20 @@ public class BrowserApp extends GeckoApp
});
}
// Custom intent action for opening multiple URLs at once
if (isViewMultipleAction) {
openMultipleTabsFromIntent(intent);
}
+ for (final BrowserAppDelegate delegate : delegates) {
+ delegate.onNewIntent(this, intent);
+ }
+
if (!mInitialized || !Intent.ACTION_MAIN.equals(action)) {
return;
}
// Check to see how many times the app has been launched.
final String keyName = getPackageName() + ".feedback_launch_count";
final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserAppDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserAppDelegate.java
@@ -1,15 +1,16 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
+import android.content.Intent;
import android.os.Bundle;
import org.mozilla.gecko.tabs.TabsPanel;
/**
* Abstract class for extending the behavior of BrowserApp without adding additional code to the
* already huge class.
*/
@@ -45,16 +46,21 @@ public abstract class BrowserAppDelegate
public void onStop(BrowserApp browserApp) {}
/**
* The final call before the BrowserApp activity is destroyed.
*/
public void onDestroy(BrowserApp browserApp) {}
/**
+ * Called when BrowserApp already exists and a new Intent to re-launch it was fired.
+ */
+ public void onNewIntent(BrowserApp browserApp, Intent intent) {}
+
+ /**
* Called when the tabs tray is opened.
*/
public void onTabsTrayShown(BrowserApp browserApp, TabsPanel tabsPanel) {}
/**
* Called when the tabs tray is closed.
*/
public void onTabsTrayHidden(BrowserApp browserApp, TabsPanel tabsPanel) {}