Bug 778247: mAppContext cleanup: BrowserApp is a subclass of GeckoApp. [r=mbrubeck]
authorSriram Ramasubramanian <sriram@mozilla.com>
Fri, 27 Jul 2012 23:31:42 -0700
changeset 100816 123e9052f37eeebb061101d36b7d5845a4d97b21
parent 100815 985bfd3aea74a596329855231817d9654eb8fd1c
child 100817 05e6057b43b0a6cfd2689839fe9c5f390f05f47a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmbrubeck
bugs778247
milestone17.0a1
Bug 778247: mAppContext cleanup: BrowserApp is a subclass of GeckoApp. [r=mbrubeck]
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -290,24 +290,24 @@ abstract public class BrowserApp extends
 
         invalidateOptionsMenu();
         mTabsPanel.refresh();
     }
 
     public View getActionBarLayout() {
         int actionBarRes;
 
-        if (!GeckoApp.mAppContext.hasPermanentMenuKey() || GeckoApp.mAppContext.isTablet())
+        if (!hasPermanentMenuKey() || isTablet())
            actionBarRes = R.layout.browser_toolbar_menu;
         else
            actionBarRes = R.layout.browser_toolbar;
 
-        LinearLayout actionBar = (LinearLayout) LayoutInflater.from(GeckoApp.mAppContext).inflate(actionBarRes, null);
+        LinearLayout actionBar = (LinearLayout) LayoutInflater.from(this).inflate(actionBarRes, null);
         actionBar.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
-                                                                (int) mAppContext.getResources().getDimension(R.dimen.browser_toolbar_height)));
+                                                                (int) getResources().getDimension(R.dimen.browser_toolbar_height)));
         return actionBar;
     }
 
     @Override
     public boolean hasTabsSideBar() {
         return (mTabsPanel != null && mTabsPanel.isSideBar());
     }
 
@@ -501,22 +501,17 @@ abstract public class BrowserApp extends
     }
 
 
     /* About:home UI */
     void updateAboutHomeTopSites() {
         if (mAboutHomeContent == null)
             return;
 
-        GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
-            public void run() {
-                mAboutHomeContent.update(GeckoApp.mAppContext,
-                        EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES));
-            }
-        });
+        mAboutHomeContent.update(this, EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES));
     }
 
     public void showAboutHome() {
         Runnable r = new AboutHomeRunnable(true);
         mMainHandler.postAtFrontOfQueue(r);
     }
 
     public void hideAboutHome() {
@@ -531,26 +526,26 @@ abstract public class BrowserApp extends
         }
 
         public void run() {
             mFormAssistPopup.hide();
             if (mShow) {
                 if (mAboutHomeContent == null) {
                     mAboutHomeContent = (AboutHomeContent) findViewById(R.id.abouthome_content);
                     mAboutHomeContent.init();
-                    mAboutHomeContent.update(GeckoApp.mAppContext, AboutHomeContent.UpdateFlags.ALL);
+                    mAboutHomeContent.update(mAppContext, AboutHomeContent.UpdateFlags.ALL);
                     mAboutHomeContent.setUriLoadCallback(new AboutHomeContent.UriLoadCallback() {
                         public void callback(String url) {
                             mBrowserToolbar.setProgressVisibility(true);
                             loadUrl(url, AwesomeBar.Target.CURRENT_TAB);
                         }
                     });
                     mAboutHomeContent.setOnInterceptTouchListener(new ContentTouchListener());
                 } else {
-                    mAboutHomeContent.update(GeckoApp.mAppContext,
+                    mAboutHomeContent.update(mAppContext,
                                              EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES,
                                                         AboutHomeContent.UpdateFlags.REMOTE_TABS));
                 }
             
                 mAboutHomeContent.setVisibility(View.VISIBLE);
             } else {
                 findViewById(R.id.abouthome_content).setVisibility(View.GONE);
             }