mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 831520 - Clear my Metro Firefox History now also clears StartUI. r=mbrubeck
This commit is contained in:
parent
d1c8253dea
commit
3dcde32cdd
@ -38,6 +38,10 @@ function TopSitesView(aGrid, maxSites) {
|
||||
|
||||
// handle selectionchange DOM events from the grid/tile group
|
||||
this._set.addEventListener("context-action", this, false);
|
||||
|
||||
let history = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
history.addObserver(this, false);
|
||||
}
|
||||
|
||||
TopSitesView.prototype = {
|
||||
@ -153,6 +157,42 @@ TopSitesView.prototype = {
|
||||
|
||||
destruct: function destruct() {
|
||||
// remove the observers here
|
||||
},
|
||||
|
||||
// nsINavHistoryObserver
|
||||
|
||||
onBeginUpdateBatch: function() {
|
||||
},
|
||||
|
||||
onEndUpdateBatch: function() {
|
||||
},
|
||||
|
||||
onVisit: function(aURI, aVisitID, aTime, aSessionID,
|
||||
aReferringID, aTransitionType) {
|
||||
},
|
||||
|
||||
onTitleChanged: function(aURI, aPageTitle) {
|
||||
},
|
||||
|
||||
onDeleteURI: function(aURI) {
|
||||
},
|
||||
|
||||
onClearHistory: function() {
|
||||
this._set.clearAll();
|
||||
},
|
||||
|
||||
onPageChanged: function(aURI, aWhat, aValue) {
|
||||
},
|
||||
|
||||
onPageExpired: function(aURI, aVisitTime, aWholeEntry) {
|
||||
},
|
||||
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsINavHistoryObserver) ||
|
||||
iid.equals(Components.interfaces.nsISupports)) {
|
||||
return this;
|
||||
}
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -188,6 +188,18 @@
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="clearAll">
|
||||
<body>
|
||||
<![CDATA[
|
||||
while (this.firstChild) {
|
||||
this.removeChild(this.firstChild);
|
||||
}
|
||||
this._grid.style.width = "0px";
|
||||
this._contextActions = null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="insertItemAt">
|
||||
<parameter name="anIndex"/>
|
||||
<parameter name="aLabel"/>
|
||||
|
@ -10,7 +10,9 @@ function HistoryView(aSet) {
|
||||
this._set = aSet;
|
||||
this._set.controller = this;
|
||||
|
||||
//add observers here
|
||||
let history = Cc["@mozilla.org/browser/nav-history-service;1"].
|
||||
getService(Ci.nsINavHistoryService);
|
||||
history.addObserver(this, false);
|
||||
}
|
||||
|
||||
HistoryView.prototype = {
|
||||
@ -49,6 +51,42 @@ HistoryView.prototype = {
|
||||
|
||||
destruct: function destruct() {
|
||||
},
|
||||
|
||||
// nsINavHistoryObserver
|
||||
|
||||
onBeginUpdateBatch: function() {
|
||||
},
|
||||
|
||||
onEndUpdateBatch: function() {
|
||||
},
|
||||
|
||||
onVisit: function(aURI, aVisitID, aTime, aSessionID,
|
||||
aReferringID, aTransitionType) {
|
||||
},
|
||||
|
||||
onTitleChanged: function(aURI, aPageTitle) {
|
||||
},
|
||||
|
||||
onDeleteURI: function(aURI) {
|
||||
},
|
||||
|
||||
onClearHistory: function() {
|
||||
this._set.clearAll();
|
||||
},
|
||||
|
||||
onPageChanged: function(aURI, aWhat, aValue) {
|
||||
},
|
||||
|
||||
onPageExpired: function(aURI, aVisitTime, aWholeEntry) {
|
||||
},
|
||||
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsINavHistoryObserver) ||
|
||||
iid.equals(Components.interfaces.nsISupports)) {
|
||||
return this;
|
||||
}
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
};
|
||||
|
||||
let HistoryStartView = {
|
||||
|
Loading…
Reference in New Issue
Block a user