Bug 934900 - Ensure back/forward are not re-enabled while in editing mode (r=sriram)

This commit is contained in:
Lucas Rocha 2013-11-11 18:43:40 +00:00
Родитель 0b54712661
Коммит 7419652e74
1 изменённых файлов: 18 добавлений и 10 удалений

Просмотреть файл

@ -671,8 +671,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
break;
case START:
if (Tabs.getInstance().isSelectedTab(tab)) {
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());
updateBackButton(canDoBack(tab));
updateForwardButton(canDoForward(tab));
Boolean showProgress = (Boolean)data;
if (showProgress && tab.getState() == Tab.STATE_LOADING)
setProgressVisibility(true);
@ -682,8 +682,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
break;
case STOP:
if (Tabs.getInstance().isSelectedTab(tab)) {
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());
updateBackButton(canDoBack(tab));
updateForwardButton(canDoForward(tab));
setProgressVisibility(false);
// Reset the title in case we haven't navigated to a new page yet.
updateTitle();
@ -711,8 +711,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
case ADDED:
updateTabCount(Tabs.getInstance().getDisplayCount());
if (Tabs.getInstance().isSelectedTab(tab)) {
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());
updateBackButton(canDoBack(tab));
updateForwardButton(canDoForward(tab));
}
break;
case FAVICON:
@ -878,6 +878,14 @@ public class BrowserToolbar extends GeckoRelativeLayout
return false;
}
private boolean canDoBack(Tab tab) {
return (tab.canDoBack() && !mIsEditing);
}
private boolean canDoForward(Tab tab) {
return (tab.canDoForward() && !mIsEditing);
}
private void addTab() {
mActivity.addTab();
}
@ -1322,8 +1330,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
final Tab tab = Tabs.getInstance().getSelectedTab();
if (tab != null) {
setButtonEnabled(mBack, enabled && tab.canDoBack());
setButtonEnabled(mForward, enabled && tab.canDoForward());
setButtonEnabled(mBack, canDoBack(tab));
setButtonEnabled(mForward, canDoForward(tab));
}
}
@ -1777,8 +1785,8 @@ public class BrowserToolbar extends GeckoRelativeLayout
setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
setSecurityMode(tab.getSecurityMode());
setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
updateBackButton(tab.canDoBack());
updateForwardButton(tab.canDoForward());
updateBackButton(canDoBack(tab));
updateForwardButton(canDoForward(tab));
final boolean isPrivate = tab.isPrivate();
setPrivateMode(isPrivate);