Bug 887268 - Allow passing an explicit EditingTarget to openUrl() (r=bnicholson)
authorLucas Rocha <lucasr@mozilla.com>
Fri, 12 Jul 2013 22:51:28 +0100
changeset 143403 45ae7d54666f9a1cb65ef9991962fc2fe98beca7
parent 143402 84d09b3378b4ab720df8cfd32be036b08470e529
child 143404 dca194f33a3626aeb3105a55a661da224ecf3e48
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs887268
milestone25.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 887268 - Allow passing an explicit EditingTarget to openUrl() (r=bnicholson)
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1243,24 +1243,32 @@ abstract public class BrowserApp extends
         super.onSaveInstanceState(outState);
         mToast.onSaveInstanceState(outState);
         outState.putBoolean(STATE_DYNAMIC_TOOLBAR_ENABLED, mDynamicToolbarEnabled);
         // FIXME: address this in bug 876750
         //outState.putInt(STATE_ABOUT_HOME_TOP_PADDING, mHomePager.getTopPadding());
     }
 
     private void openUrl(String url) {
-        openUrl(url, null);
+        openUrl(url, null, mBrowserToolbar.getEditingTarget());
+    }
+
+    private void openUrl(String url, EditingTarget target) {
+        openUrl(url, null, target);
     }
 
     private void openUrl(String url, String searchEngine) {
+        openUrl(url, searchEngine, mBrowserToolbar.getEditingTarget());
+    }
+
+    private void openUrl(String url, String searchEngine, EditingTarget target) {
         mBrowserToolbar.setProgressVisibility(true);
 
         int flags = Tabs.LOADURL_NONE;
-        if (mBrowserToolbar.getEditingTarget() == EditingTarget.NEW_TAB) {
+        if (target == EditingTarget.NEW_TAB) {
             flags |= Tabs.LOADURL_NEW_TAB;
         }
 
         Tabs.getInstance().loadUrl(url, searchEngine, -1, flags);
 
         hideBrowserSearch();
         mBrowserToolbar.cancelEdit();
     }