Bug 760267: Making the menu variable a member variable than a static variable. r=blassey

This commit is contained in:
Sriram Ramasubramanian 2012-06-13 12:58:57 -07:00
parent 3b596c5f53
commit acd1901e47

View File

@ -93,7 +93,7 @@ abstract public class GeckoApp
public static GeckoApp mAppContext;
public static boolean mDOMFullScreen = false;
protected MenuPanel mMenuPanel;
public static Menu sMenu;
public Menu sMenu;
private static GeckoThread sGeckoThread = null;
public Handler mMainHandler;
private GeckoProfile mProfile;
@ -1029,10 +1029,11 @@ abstract public class GeckoApp
handleDoorHangerRemove(message);
} else if (event.equals("Gecko:Ready")) {
sIsGeckoReady = true;
final Menu menu = sMenu;
mMainHandler.post(new Runnable() {
public void run() {
if (sMenu != null)
sMenu.findItem(R.id.settings).setEnabled(true);
if (menu != null)
menu.findItem(R.id.settings).setEnabled(true);
}
});
setLaunchState(GeckoApp.LaunchState.GeckoRunning);
@ -1088,10 +1089,11 @@ abstract public class GeckoApp
} else if (event.equals("CharEncoding:State")) {
final boolean visible = message.getString("visible").equals("true");
GeckoPreferences.setCharEncodingState(visible);
final Menu menu = sMenu;
mMainHandler.post(new Runnable() {
public void run() {
if (sMenu != null)
sMenu.findItem(R.id.char_encoding).setVisible(visible);
if (menu != null)
menu.findItem(R.id.char_encoding).setVisible(visible);
}
});
} else if (event.equals("Update:Restart")) {