Bug 976232 - Disable home banner in guest mode. r=wesj

This commit is contained in:
Margaret Leibovic 2014-03-12 08:57:30 -07:00
Родитель dc3c6728da
Коммит 43c8c5a29d
1 изменённых файлов: 15 добавлений и 9 удалений

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

@ -1694,16 +1694,22 @@ abstract public class BrowserApp extends GeckoApp
mHomePager = (HomePager) homePagerStub.inflate();
final HomeBanner homeBanner = (HomeBanner) findViewById(R.id.home_banner);
mHomePager.setBanner(homeBanner);
// Remove the banner from the view hierarchy if it is dismissed.
homeBanner.setOnDismissListener(new HomeBanner.OnDismissListener() {
@Override
public void onDismiss() {
mHomePager.setBanner(null);
mHomePagerContainer.removeView(homeBanner);
}
});
// Never show the home banner in guest mode.
if (GeckoProfile.get(this).inGuestMode()) {
mHomePagerContainer.removeView(homeBanner);
} else {
mHomePager.setBanner(homeBanner);
// Remove the banner from the view hierarchy if it is dismissed.
homeBanner.setOnDismissListener(new HomeBanner.OnDismissListener() {
@Override
public void onDismiss() {
mHomePager.setBanner(null);
mHomePagerContainer.removeView(homeBanner);
}
});
}
}
mHomePagerContainer.setVisibility(View.VISIBLE);