зеркало из https://github.com/mozilla/gecko-dev.git
Bug 976232 - Disable home banner in guest mode. r=wesj
This commit is contained in:
Родитель
dc3c6728da
Коммит
43c8c5a29d
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче