Bug 760267: Using proper naming convention for non-static menu variable. r=mfinkle r=blassey

This commit is contained in:
Sriram Ramasubramanian 2012-06-13 13:28:00 -07:00
parent 8cb3070a28
commit cb4c8a9724
2 changed files with 20 additions and 17 deletions

View File

@ -498,14 +498,14 @@ abstract public class BrowserApp extends GeckoApp
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
sMenu = menu;
mMenu = menu;
// Inform the menu about the action-items bar.
if (menu instanceof GeckoMenu && isTablet())
((GeckoMenu) menu).setActionItemBarPresenter(mBrowserToolbar);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.gecko_menu, sMenu);
inflater.inflate(R.menu.gecko_menu, mMenu);
return true;
}

View File

@ -93,7 +93,7 @@ abstract public class GeckoApp
public static GeckoApp mAppContext;
public static boolean mDOMFullScreen = false;
protected MenuPanel mMenuPanel;
public Menu sMenu;
protected Menu mMenu;
private static GeckoThread sGeckoThread = null;
public Handler mMainHandler;
private GeckoProfile mProfile;
@ -410,10 +410,10 @@ abstract public class GeckoApp
}
private void addAddonMenuItem(final int id, final String label, final String icon) {
if (sMenu == null)
if (mMenu == null)
return;
final MenuItem item = sMenu.add(Menu.NONE, id, Menu.NONE, label);
final MenuItem item = mMenu.add(Menu.NONE, id, Menu.NONE, label);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
@ -455,12 +455,12 @@ abstract public class GeckoApp
if (item.getItemId() == id) {
sAddonMenuItems.remove(item);
if (sMenu == null)
if (mMenu == null)
break;
MenuItem menuItem = sMenu.findItem(id);
MenuItem menuItem = mMenu.findItem(id);
if (menuItem != null)
sMenu.removeItem(id);
mMenu.removeItem(id);
break;
}
@ -469,10 +469,10 @@ abstract public class GeckoApp
@Override
public void invalidateOptionsMenu() {
if (sMenu == null)
if (mMenu == null)
return;
onPrepareOptionsMenu(sMenu);
onPrepareOptionsMenu(mMenu);
if (Build.VERSION.SDK_INT >= 11)
super.invalidateOptionsMenu();
@ -481,16 +481,19 @@ abstract public class GeckoApp
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
sMenu = menu;
mMenu = menu;
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.gecko_menu, sMenu);
inflater.inflate(R.menu.gecko_menu, mMenu);
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu aMenu)
{
if (aMenu == null)
return false;
if (!sIsGeckoReady)
aMenu.findItem(R.id.settings).setEnabled(false);
@ -590,7 +593,7 @@ abstract public class GeckoApp
mMenuPanel = new MenuPanel(mAppContext, null);
} else {
// Prepare the panel everytime before showing the menu.
onPreparePanel(featureId, mMenuPanel, sMenu);
onPreparePanel(featureId, mMenuPanel, mMenu);
}
return mMenuPanel;
@ -627,9 +630,9 @@ abstract public class GeckoApp
@Override
public boolean onMenuOpened(int featureId, Menu menu) {
if (Build.VERSION.SDK_INT >= 11 && featureId == Window.FEATURE_OPTIONS_PANEL) {
if (sMenu == null) {
if (mMenu == null) {
onCreatePanelMenu(featureId, menu);
onPreparePanel(featureId, mMenuPanel, sMenu);
onPreparePanel(featureId, mMenuPanel, mMenu);
}
// Scroll custom menu to the top
@ -1029,7 +1032,7 @@ abstract public class GeckoApp
handleDoorHangerRemove(message);
} else if (event.equals("Gecko:Ready")) {
sIsGeckoReady = true;
final Menu menu = sMenu;
final Menu menu = mMenu;
mMainHandler.post(new Runnable() {
public void run() {
if (menu != null)
@ -1089,7 +1092,7 @@ 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;
final Menu menu = mMenu;
mMainHandler.post(new Runnable() {
public void run() {
if (menu != null)