Bug 952894 - Use existing triggers to clear open search engines state r=rnewman

This commit is contained in:
Mark Finkle 2013-12-28 22:14:13 -05:00
parent be3a852b60
commit 5f07023e42
4 changed files with 5 additions and 18 deletions

View File

@ -637,6 +637,7 @@ public class Tab {
clearFavicon();
setHasFeeds(false);
setHasOpenSearch(false);
updateTitle(null);
updateIdentityData(null);
setReaderEnabled(false);

View File

@ -18,8 +18,7 @@
android:title="@string/contextmenu_subscribe"/>
<item android:id="@+id/add_search_engine"
android:title="@string/contextmenu_add_search_engine"
android:visible="false"/>
android:title="@string/contextmenu_add_search_engine"/>
<item android:id="@+id/copyurl"
android:title="@string/contextmenu_copyurl"/>

View File

@ -365,10 +365,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
menu.findItem(R.id.add_to_launcher).setVisible(false);
}
if (!tab.hasFeeds()) {
menu.findItem(R.id.subscribe).setVisible(false);
}
menu.findItem(R.id.subscribe).setVisible(tab.hasFeeds());
menu.findItem(R.id.add_search_engine).setVisible(tab.hasOpenSearch());
} else {
// if there is no tab, remove anything tab dependent

View File

@ -3777,18 +3777,8 @@ Tab.prototype = {
// Clear page-specific opensearch engines and feeds for a new request.
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START && aRequest && aWebProgress.isTopLevel) {
this.browser.engines = null;
// Send message to clear search engine option in context menu.
let newEngineMessage = {
type: "Link:OpenSearch",
tabID: this.id,
visible: false
};
sendMessageToJava(newEngineMessage);
this.browser.feeds = null;
this.browser.engines = null;
this.browser.feeds = null;
}
// true if the page loaded successfully (i.e., no 404s or other errors)