Bug 906041 - Part 1: Don't change the visibility of the home pager if we're in editing mode. r=lucasr, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 17 Sep 2013 09:13:54 -0400
changeset 155404 de6a9e752331
parent 155403 290e1e44e8b3
child 155405 3a26eee37c0d
push id4271
push userryanvm@gmail.com
push dateThu, 19 Sep 2013 17:54:57 +0000
treeherdermozilla-aurora@3a26eee37c0d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs906041
milestone26.0a2
Bug 906041 - Part 1: Don't change the visibility of the home pager if we're in editing mode. r=lucasr, a=lsblakk
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -177,26 +177,17 @@ abstract public class BrowserApp extends
         switch(msg) {
             case LOCATION_CHANGE:
                 if (Tabs.getInstance().isSelectedTab(tab)) {
                     maybeCancelFaviconLoad(tab);
                 }
                 // fall through
             case SELECTED:
                 if (Tabs.getInstance().isSelectedTab(tab)) {
-                    if (isAboutHome(tab)) {
-                        showHomePager(tab.getAboutHomePage());
-
-                        if (isDynamicToolbarEnabled()) {
-                            // Show the toolbar.
-                            mLayerView.getLayerMarginsAnimator().showMargins(false);
-                        }
-                    } else {
-                        hideHomePager();
-                    }
+                    updateHomePagerForTab(tab);
 
                     if (mSiteIdentityPopup != null)
                         mSiteIdentityPopup.dismiss();
 
                     final TabsPanel.Panel panel = tab.isPrivate()
                                                 ? TabsPanel.Panel.PRIVATE_TABS
                                                 : TabsPanel.Panel.NORMAL_TABS;
                     // Delay calling showTabs so that it does not modify the mTabsChangedListeners
@@ -1503,16 +1494,37 @@ abstract public class BrowserApp extends
             hideBrowserSearch();
         } else {
             showBrowserSearch();
             mHomePager.setVisibility(View.INVISIBLE);
             mBrowserSearch.filter(searchTerm, handler);
         }
     }
 
+    /**
+     * Shows or hides the home pager for the given tab.
+     */
+    private void updateHomePagerForTab(Tab tab) {
+        // Don't change the visibility of the home pager if we're in editing mode.
+        if (mBrowserToolbar.isEditing()) {
+            return;
+        }
+
+        if (isAboutHome(tab)) {
+            showHomePager(tab.getAboutHomePage());
+
+            if (isDynamicToolbarEnabled()) {
+                // Show the toolbar.
+                mLayerView.getLayerMarginsAnimator().showMargins(false);
+            }
+        } else {
+            hideHomePager();
+        }
+    }
+
     private void showHomePager(HomePager.Page page) {
         showHomePagerWithAnimator(page, null);
     }
 
     private void showHomePagerWithAnimator(HomePager.Page page, PropertyAnimator animator) {
         if (isHomePagerVisible()) {
             return;
         }