зеркало из https://github.com/mozilla/gecko-dev.git
Bug 752001 - Remove unnecessary indirection for stop/reload/forward actions. r=mfinkle
This commit is contained in:
Родитель
a89c23bb96
Коммит
2e9a628b4a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче