Bug 805600 - Code cleanup: remove sIsGeckoReady; r=kats
authorGeoff Brown <gbrown@mozilla.com>
Sat, 27 Oct 2012 13:18:26 -0600
changeset 111749 fdefe523f873a2022d3e0c78026ac87940344f40
parent 111748 43e09a8466c25bdd618cfae78bf39364ea32a80e
child 111750 7426b782e0b9494109079eb11d915b65cb0e4f58
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerskats
bugs805600
milestone19.0a1
Bug 805600 - Code cleanup: remove sIsGeckoReady; r=kats
mobile/android/base/AboutHomeContent.java
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/AboutHomeContent.java
+++ b/mobile/android/base/AboutHomeContent.java
@@ -458,17 +458,17 @@ public class AboutHomeContent extends Sc
                 } catch (JSONException e) {
                     Log.i(LOGTAG, "error reading json file", e);
                 }
             }
         });
     }
 
     private void readLastTabs() {
-        String jsonString = mActivity.getProfile().readSessionFile(GeckoApp.sIsGeckoReady);
+        String jsonString = mActivity.getProfile().readSessionFile(GeckoApp.checkLaunchState(GeckoApp.LaunchState.GeckoRunning));
         if (jsonString == null) {
             // no previous session data
             return;
         }
 
         final JSONArray tabs;
         try {
             tabs = new JSONObject(jsonString).getJSONArray("windows")
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -457,17 +457,17 @@ abstract public class BrowserApp extends
         showTabs(TabsPanel.Panel.LOCAL_TABS);
     }
 
     public void showRemoteTabs() {
         showTabs(TabsPanel.Panel.REMOTE_TABS);
     }
 
     private void showTabs(TabsPanel.Panel panel) {
-        if (!sIsGeckoReady)
+        if (!checkLaunchState(LaunchState.GeckoRunning))
             return;
 
         mTabsPanel.show(panel);
     }
 
     public void hideTabs() {
         mTabsPanel.hide();
     }
@@ -841,17 +841,17 @@ abstract public class BrowserApp extends
       });
     }
 
     @Override
     public boolean onPrepareOptionsMenu(Menu aMenu) {
         if (aMenu == null)
             return false;
 
-        if (!sIsGeckoReady)
+        if (!checkLaunchState(LaunchState.GeckoRunning))
             aMenu.findItem(R.id.settings).setEnabled(false);
 
         Tab tab = Tabs.getInstance().getSelectedTab();
         MenuItem bookmark = aMenu.findItem(R.id.bookmark);
         MenuItem forward = aMenu.findItem(R.id.forward);
         MenuItem share = aMenu.findItem(R.id.share);
         MenuItem saveAsPDF = aMenu.findItem(R.id.save_as_pdf);
         MenuItem charEncoding = aMenu.findItem(R.id.char_encoding);
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -158,17 +158,16 @@ abstract public class GeckoApp
     public static GeckoApp mAppContext;
     public boolean mDOMFullScreen = false;
     protected MenuPresenter mMenuPresenter;
     protected MenuPanel mMenuPanel;
     protected Menu mMenu;
     private static GeckoThread sGeckoThread;
     public Handler mMainHandler;
     private GeckoProfile mProfile;
-    public static boolean sIsGeckoReady = false;
     public static int mOrientation;
     private boolean mIsRestoringActivity;
     private String mCurrentResponse = "";
     public static boolean sIsUsingCustomProfile = false;
 
     private PromptService mPromptService;
     private Favicons mFavicons;
     private TextSelection mTextSelection;
@@ -974,17 +973,16 @@ abstract public class GeckoApp
                 final String uri = message.getString("uri");
                 final String title = message.getString("title");
                 handleLoadError(tabId, uri, title);
             } else if (event.equals("Content:PageShow")) {
                 final int tabId = message.getInt("tabID");
                 handlePageShow(tabId);
             } else if (event.equals("Gecko:Ready")) {
                 mGeckoReadyStartupTimer.stop();
-                sIsGeckoReady = true;
                 setLaunchState(GeckoApp.LaunchState.GeckoRunning);
                 GeckoAppShell.sendPendingEventsToGecko();
                 connectGeckoLayerClient();
             } else if (event.equals("ToggleChrome:Hide")) {
                 toggleChrome(false);
             } else if (event.equals("ToggleChrome:Show")) {
                 toggleChrome(true);
             } else if (event.equals("ToggleChrome:Focus")) {