Bug 917805 - Use Tabs.loadUrl() for immediate reaction to ACTION_VIEW intents (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 01 Oct 2013 17:15:44 +0100
changeset 149468 94709aa5280322b50d6e0d6f766e6074e52fc7c5
parent 149467 961a0bc211ea5e76c40f4de391a6b98e0c441166
child 149469 8953d11c8c6236f63f6cd94da10f3d96ca061e0f
push id25390
push userryanvm@gmail.com
push dateTue, 01 Oct 2013 20:43:13 +0000
treeherdermozilla-central@df452c8738ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs917805
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 917805 - Use Tabs.loadUrl() for immediate reaction to ACTION_VIEW intents (r=margaret)
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2170,19 +2170,16 @@ abstract public class BrowserApp extends
 
         if (!mInitialized) {
             return;
         }
 
         // Dismiss editing mode if the user is loading a URL from an external app.
         if (Intent.ACTION_VIEW.equals(action)) {
             dismissEditingMode();
-
-            // Show the target URL immediately in the toolbar
-            mBrowserToolbar.setTitle(intent.getDataString());
             return;
         }
 
         // Only solicit feedback when the app has been launched from the icon shortcut.
         if (!Intent.ACTION_MAIN.equals(action)) {
             return;
         }
 
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1818,17 +1818,19 @@ abstract public class GeckoApp
 
         final String action = intent.getAction();
 
         if (ACTION_LOAD.equals(action)) {
             String uri = intent.getDataString();
             Tabs.getInstance().loadUrl(uri);
         } else if (Intent.ACTION_VIEW.equals(action)) {
             String uri = intent.getDataString();
-            GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri));
+            Tabs.getInstance().loadUrl(uri, Tabs.LOADURL_NEW_TAB |
+                                            Tabs.LOADURL_USER_ENTERED |
+                                            Tabs.LOADURL_EXTERNAL);
         } else if (action != null && action.startsWith(ACTION_WEBAPP_PREFIX)) {
             String uri = getURIFromIntent(intent);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createWebappLoadEvent(uri));
         } else if (ACTION_BOOKMARK.equals(action)) {
             String uri = getURIFromIntent(intent);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createBookmarkLoadEvent(uri));
         } else if (Intent.ACTION_SEARCH.equals(action)) {
             String uri = getURIFromIntent(intent);