Bug 752001 - Remove unnecessary indirection for stop/reload/forward actions. r=mfinkle

This commit is contained in:
Margaret Leibovic 2012-05-04 12:52:13 -07:00
parent 5469fb621c
commit bdea1a3ca6
2 changed files with 9 additions and 34 deletions

View File

@ -190,7 +190,9 @@ public class BrowserToolbar {
mStop = (ImageButton) mLayout.findViewById(R.id.stop);
mStop.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
doStop();
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab != null)
tab.doStop();
}
});
@ -221,10 +223,6 @@ public class BrowserToolbar {
GeckoApp.mAppContext.showTabs();
}
private void doStop() {
GeckoApp.mAppContext.doStop();
}
public int getHighlightColor() {
return mColor;
}

View File

@ -509,10 +509,14 @@ abstract public class GeckoApp
}
return true;
case R.id.reload:
doReload();
tab = Tabs.getInstance().getSelectedTab();
if (tab != null)
tab.doReload();
return true;
case R.id.forward:
doForward();
tab = Tabs.getInstance().getSelectedTab();
if (tab != null)
tab.doForward();
return true;
case R.id.save_as_pdf:
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("SaveAs:PDF", null));
@ -2533,33 +2537,6 @@ abstract public class GeckoApp
return true;
}
public boolean doReload() {
Log.i(LOGTAG, "Reload requested");
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab == null)
return false;
return tab.doReload();
}
public boolean doForward() {
Log.i(LOGTAG, "Forward requested");
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab == null)
return false;
return tab.doForward();
}
public boolean doStop() {
Log.i(LOGTAG, "Stop requested");
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab == null)
return false;
return tab.doStop();
}
@Override
public void onBackPressed() {
if (mDoorHangerPopup.isShowing()) {