Bug 895819 - Show "Visited" tab when about:home URL bar tapped, r=lucasr
authorMark Capella <markcapella@twcny.rr.com>
Mon, 22 Jul 2013 15:22:19 -0400
changeset 143423 2c8f72dc409c2a813f593aa1fd9fd0b1168d323b
parent 143422 31d437a61ce1bebf23b5a9f4145006479ae33303
child 143424 8e852b2a313a362dbdc2aa14dd1912ee474a334c
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)
reviewerslucasr
bugs895819
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 895819 - Show "Visited" tab when about:home URL bar tapped, r=lucasr
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -417,17 +417,17 @@ abstract public class BrowserApp extends
         mBrowserSearch = (BrowserSearch) getSupportFragmentManager().findFragmentByTag(BROWSER_SEARCH_TAG);
         if (mBrowserSearch == null) {
             mBrowserSearch = BrowserSearch.newInstance();
             mBrowserSearch.setUserVisibleHint(false);
         }
 
         mBrowserToolbar.setOnActivateListener(new BrowserToolbar.OnActivateListener() {
             public void onActivate() {
-                enterEditingMode(EditingTarget.CURRENT_TAB);
+                enterEditingMode(EditingTarget.CURRENT_TAB, HomePager.Page.VISITED);
             }
         });
 
         mBrowserToolbar.setOnCommitListener(new BrowserToolbar.OnCommitListener() {
             public void onCommit(EditingTarget target) {
                 commitEditingMode(target);
             }
         });
@@ -1291,35 +1291,43 @@ abstract public class BrowserApp extends
         // Cancel pending favicon load task
         Favicons.getInstance().cancelFaviconLoad(faviconLoadId);
 
         // Reset favicon load state
         tab.setFaviconLoadId(Favicons.NOT_LOADING);
     }
 
     public boolean enterEditingMode(EditingTarget target) {
-        return enterEditingMode(target, null);
+        return enterEditingMode(target, null, HomePager.Page.BOOKMARKS);
     }
 
-    boolean enterEditingMode(EditingTarget target, String url) {
+    public boolean enterEditingMode(EditingTarget target, String url) {
+        return enterEditingMode(target, url, HomePager.Page.BOOKMARKS);
+    }
+
+    public boolean enterEditingMode(EditingTarget target, HomePager.Page page) {
+        return enterEditingMode(target, null, page);
+    }
+
+    boolean enterEditingMode(EditingTarget target, String url, HomePager.Page page) {
         // If we're editing the current tab, show its URL.
         if (TextUtils.isEmpty(url) && target == EditingTarget.CURRENT_TAB) {
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null) {
                 // Check to see if there's a user-entered search term, which we save
                 // whenever the user performs a search.
                 url = tab.getUserSearch();
                 if (TextUtils.isEmpty(url)) {
                     url = tab.getURL();
                 }
             }
         }
 
         mBrowserToolbar.startEditing(target, url);
-        animateShowHomePager();
+        animateShowHomePager(page);
 
         return true;
     }
 
     void commitEditingMode(EditingTarget target) {
         if (!mBrowserToolbar.isEditing()) {
             return;
         }
@@ -1354,21 +1362,21 @@ abstract public class BrowserApp extends
         if (TextUtils.isEmpty(searchTerm)) {
             hideBrowserSearch();
         } else {
             showBrowserSearch();
             mBrowserSearch.filter(searchTerm, handler);
         }
     }
 
-    private void animateShowHomePager() {
-        showHomePagerWithAnimation(true, HomePager.Page.BOOKMARKS);
+    private void animateShowHomePager(HomePager.Page page) {
+        showHomePagerWithAnimation(true, page);
     }
 
-     private void showHomePager(HomePager.Page page) {
+    private void showHomePager(HomePager.Page page) {
         showHomePagerWithAnimation(false, page);
     }
 
     private void showHomePagerWithAnimation(boolean animate, HomePager.Page page) {
         if (mHomePager.isVisible()) {
             return;
         }