mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 971413 - Send Reader:Removed as response to Reader:Remove. r=lucasr
This commit is contained in:
parent
07c8bdbe5d
commit
c84b12ea0a
@ -244,18 +244,17 @@ abstract class HomeFragment extends Fragment {
|
||||
if (mInReadingList) {
|
||||
GeckoEvent e = GeckoEvent.createBroadcastEvent("Reader:Remove", mUrl);
|
||||
GeckoAppShell.sendEventToGecko(e);
|
||||
|
||||
int count = BrowserDB.getReadingListCount(cr);
|
||||
e = GeckoEvent.createBroadcastEvent("Reader:ListCountUpdated", Integer.toString(count));
|
||||
GeckoAppShell.sendEventToGecko(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostExecute(Void result) {
|
||||
int messageId = mInReadingList ? R.string.reading_list_removed : R.string.bookmark_removed;
|
||||
Toast.makeText(mContext, messageId, Toast.LENGTH_SHORT).show();
|
||||
// The remove from reading list toast is handled in Reader:Removed,
|
||||
// so handle only the bookmark removed toast here.
|
||||
if (!mInReadingList) {
|
||||
Toast.makeText(mContext, R.string.bookmark_removed, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -352,16 +352,10 @@ AboutReader.prototype = {
|
||||
});
|
||||
}.bind(this));
|
||||
} else {
|
||||
gChromeWin.Reader.removeArticleFromCache(this._article.url , function(success) {
|
||||
dump("Reader:Remove (in reader) success=" + success);
|
||||
|
||||
Services.obs.notifyObservers(null, "Reader:Remove", this._article.url);
|
||||
|
||||
gChromeWin.sendMessageToJava({
|
||||
type: "Reader:Removed",
|
||||
url: this._article.url
|
||||
});
|
||||
}.bind(this));
|
||||
// In addition to removing the article from the cache (handled in
|
||||
// browser.js), sending this message will cause the toggle button to be
|
||||
// updated (handled in this file).
|
||||
Services.obs.notifyObservers(null, "Reader:Remove", this._article.url);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -7571,6 +7571,13 @@ let Reader = {
|
||||
case "Reader:Remove": {
|
||||
this.removeArticleFromCache(aData, function(success) {
|
||||
this.log("Reader:Remove success=" + success + ", url=" + aData);
|
||||
|
||||
if (success) {
|
||||
sendMessageToJava({
|
||||
type: "Reader:Removed",
|
||||
url: url
|
||||
});
|
||||
}
|
||||
}.bind(this));
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user