mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 826723 - Don't show suggestions or prompt in private tabs. r=mfinkle
This commit is contained in:
parent
b6b0bb54c1
commit
e23c3d60d2
@ -156,6 +156,14 @@ public class Tabs implements GeckoEventListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the selected tab.
|
||||
*
|
||||
* The selected tab can be null if we're doing a session restore after a
|
||||
* crash and Gecko isn't ready yet.
|
||||
*
|
||||
* @return the selected tab, or null if no tabs exist
|
||||
*/
|
||||
public Tab getSelectedTab() {
|
||||
return mSelectedTab;
|
||||
}
|
||||
|
@ -575,6 +575,13 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
|
||||
if (name.equals(suggestEngine) && suggestTemplate != null) {
|
||||
// suggest engine should be at the front of the list
|
||||
mSearchEngines.add(0, new SearchEngine(name, icon));
|
||||
|
||||
// The only time Tabs.getInstance().getSelectedTab() should
|
||||
// be null is when we're restoring after a crash. We should
|
||||
// never restore private tabs when that happens, so it
|
||||
// should be safe to assume that null means non-private.
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab == null || !tab.isPrivate())
|
||||
mSuggestClient = new SuggestClient(GeckoApp.mAppContext, suggestTemplate, SUGGESTION_TIMEOUT, SUGGESTION_MAX);
|
||||
} else {
|
||||
mSearchEngines.add(new SearchEngine(name, icon));
|
||||
|
Loading…
Reference in New Issue
Block a user