mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1022238 - Part 1: Back out bug 1011714. r=margaret
This commit is contained in:
parent
519fd87722
commit
330aca79c6
@ -416,6 +416,19 @@ abstract public class BrowserApp extends GeckoApp
|
||||
return values;
|
||||
}
|
||||
|
||||
void handleReaderRemoved(final String url) {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
BrowserDB.removeReadingListItemWithURL(getContentResolver(), url);
|
||||
showToast(R.string.page_removed, Toast.LENGTH_SHORT);
|
||||
|
||||
final int count = BrowserDB.getReadingListCount(getContentResolver());
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Reader:ListCountUpdated", Integer.toString(count)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void handleReaderFaviconRequest(final String url) {
|
||||
(new UiAsyncTask<Void, Void, String>(ThreadUtils.getBackgroundHandler()) {
|
||||
@Override
|
||||
@ -529,6 +542,7 @@ abstract public class BrowserApp extends GeckoApp
|
||||
"Menu:Add",
|
||||
"Menu:Remove",
|
||||
"Reader:ListStatusRequest",
|
||||
"Reader:Removed",
|
||||
"Reader:Share",
|
||||
"Settings:Show",
|
||||
"Telemetry:Gather",
|
||||
@ -881,6 +895,7 @@ abstract public class BrowserApp extends GeckoApp
|
||||
"Menu:Add",
|
||||
"Menu:Remove",
|
||||
"Reader:ListStatusRequest",
|
||||
"Reader:Removed",
|
||||
"Reader:Share",
|
||||
"Settings:Show",
|
||||
"Telemetry:Gather",
|
||||
@ -1211,6 +1226,10 @@ abstract public class BrowserApp extends GeckoApp
|
||||
} else if ("Reader:ListStatusRequest".equals(event)) {
|
||||
handleReaderListStatusRequest(message.getString("url"));
|
||||
|
||||
} else if ("Reader:Removed".equals(event)) {
|
||||
final String url = message.getString("url");
|
||||
handleReaderRemoved(url);
|
||||
|
||||
} else if ("Reader:Share".equals(event)) {
|
||||
final String title = message.getString("title");
|
||||
final String url = message.getString("url");
|
||||
|
@ -7323,6 +7323,13 @@ let Reader = {
|
||||
let url = aData;
|
||||
this.removeArticleFromCache(url, function(success) {
|
||||
this.log("Reader:Remove success=" + success + ", url=" + url);
|
||||
|
||||
if (success) {
|
||||
sendMessageToJava({
|
||||
type: "Reader:Removed",
|
||||
url: url
|
||||
});
|
||||
}
|
||||
}.bind(this));
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user