Bug 906041 - (Part 1) Don't change the visibility of the home pager if we're in editing mode. r=lucasr

This commit is contained in:
Margaret Leibovic 2013-09-17 09:13:54 -04:00
parent 5931cc9ca6
commit a7723f6c77

View File

@ -182,16 +182,7 @@ abstract public class BrowserApp extends GeckoApp
// fall through
case SELECTED:
if (Tabs.getInstance().isSelectedTab(tab)) {
if (isAboutHome(tab)) {
showHomePager(tab.getAboutHomePage());
if (isDynamicToolbarEnabled()) {
// Show the toolbar.
mLayerView.getLayerMarginsAnimator().showMargins(false);
}
} else {
hideHomePager();
}
updateHomePagerForTab(tab);
if (mSiteIdentityPopup != null)
mSiteIdentityPopup.dismiss();
@ -1508,6 +1499,27 @@ abstract public class BrowserApp extends GeckoApp
}
}
/**
* Shows or hides the home pager for the given tab.
*/
private void updateHomePagerForTab(Tab tab) {
// Don't change the visibility of the home pager if we're in editing mode.
if (mBrowserToolbar.isEditing()) {
return;
}
if (isAboutHome(tab)) {
showHomePager(tab.getAboutHomePage());
if (isDynamicToolbarEnabled()) {
// Show the toolbar.
mLayerView.getLayerMarginsAnimator().showMargins(false);
}
} else {
hideHomePager();
}
}
private void showHomePager(HomePager.Page page) {
showHomePagerWithAnimator(page, null);
}