Bug 780367 - AboutHomeContent should no longer have two views. r=sriram, a=lsblakk
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 06 Aug 2012 20:27:04 -0400
changeset 100492 acf8046887e088efc2e04649fe459dc9c8fe76f6
parent 100491 7567e848fd44b9bbad0a1caabace54c28020eb1c
child 100493 29e0218edeb7d450f59f9a873d0fef33cc3829a7
push id1269
push userryanvm@gmail.com
push dateTue, 14 Aug 2012 01:04:52 +0000
treeherdermozilla-beta@29e0218edeb7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram, lsblakk
bugs780367
milestone15.0
Bug 780367 - AboutHomeContent should no longer have two views. r=sriram, a=lsblakk
mobile/android/base/AboutHomeContent.java
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/AboutHomeContent.java
+++ b/mobile/android/base/AboutHomeContent.java
@@ -328,27 +328,27 @@ public class AboutHomeContent extends Sc
         update(activity, EnumSet.of(UpdateFlags.TOP_SITES));
     }
 
     private void setTopSitesConstants() {
         mNumberOfTopSites = getResources().getInteger(R.integer.number_of_top_sites);
         mNumberOfCols = getResources().getInteger(R.integer.number_of_top_sites_cols);
     }
 
-    @Override
-    public void onConfigurationChanged(Configuration newConfig) {
+    /**
+     * Reinflates and updates all components of this view.
+     */
+    public void refresh() {
         if (mTopSitesAdapter != null)
             mTopSitesAdapter.notifyDataSetChanged();
 
         removeAllViews(); // We must remove the currently inflated view to allow for reinflation.
         inflate();
         mTopSitesGrid.setAdapter(mTopSitesAdapter); // mTopSitesGrid is a new instance (from loadTopSites()).
         update(AboutHomeContent.UpdateFlags.ALL); // Refresh all elements.
-
-        super.onConfigurationChanged(newConfig);
     }
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent event) {
         if (mOnInterceptTouchListener != null && mOnInterceptTouchListener.onInterceptTouchEvent(this, event))
             return true;
         return super.onInterceptTouchEvent(event);
     }
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -293,16 +293,19 @@ abstract public class BrowserApp extends
             LinearLayout actionBar = (LinearLayout) getBrowserToolbar();
             mMainLayout.addView(actionBar, index);
             mBrowserToolbar.from(actionBar);
             mBrowserToolbar.refresh();
         }
 
         invalidateOptionsMenu();
         mTabsPanel.refresh();
+
+        if (mAboutHomeContent != null)
+            mAboutHomeContent.refresh();
     }
 
     @Override
     public boolean isBrowserToolbarSupported() {
         return true;
     }
 
     @Override