mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 702386 - Support setting persistence to -1 for doorhangers (and fix buggy doorhanger removal code). r=mfinkle
This commit is contained in:
parent
2b2c9c3c76
commit
27eece2b4f
@ -146,7 +146,9 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
|
||||
// This method checks with persistence and timeout options to see if
|
||||
// it's okay to remove a doorhanger.
|
||||
public boolean shouldRemove() {
|
||||
if (mPersistence > 0) {
|
||||
// If persistence is set to -1, the doorhanger will never be
|
||||
// automatically removed.
|
||||
if (mPersistence != 0) {
|
||||
mPersistence--;
|
||||
return false;
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ abstract public class GeckoApp
|
||||
tab.updateFavicon(null);
|
||||
tab.updateFaviconURL(null);
|
||||
tab.updateSecurityMode("unknown");
|
||||
tab.removeAllDoorHangers();
|
||||
tab.removeTransientDoorHangers();
|
||||
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -245,16 +245,19 @@ public class Tab {
|
||||
}
|
||||
|
||||
public void removeDoorHanger(String value) {
|
||||
DoorHanger dh = mDoorHangers.get(value);
|
||||
// Check to see if we should remove a doorhanger before removing it
|
||||
if (dh.shouldRemove())
|
||||
mDoorHangers.remove(value);
|
||||
mDoorHangers.remove(value);
|
||||
}
|
||||
|
||||
public void removeAllDoorHangers() {
|
||||
mDoorHangers = new HashMap<String, DoorHanger>();
|
||||
}
|
||||
|
||||
public void removeTransientDoorHangers() {
|
||||
for (String value : mDoorHangers.keySet()) {
|
||||
removeDoorHanger(value);
|
||||
}
|
||||
DoorHanger dh = mDoorHangers.get(value);
|
||||
if (dh.shouldRemove())
|
||||
mDoorHangers.remove(value);
|
||||
}
|
||||
}
|
||||
|
||||
public DoorHanger getDoorHanger(String value) {
|
||||
|
@ -667,7 +667,8 @@ var NativeWindow = {
|
||||
* An options JavaScript object holding additional properties for the
|
||||
* notification. The following properties are currently supported:
|
||||
* persistence: An integer. The notification will not automatically
|
||||
* dismiss for this many page loads.
|
||||
* dismiss for this many page loads. If persistence is set
|
||||
* to -1, the doorhanger will never automatically dismiss.
|
||||
* timeout: A time in milliseconds. The notification will not
|
||||
* automatically dismiss before this time.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user