AeroPeek関係について、最小限の実装で済ませるようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6573 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-04-06 13:59:13 +00:00
parent e438cc6fa8
commit 36e8eeea2c
2 changed files with 9 additions and 42 deletions

View File

@ -1545,7 +1545,6 @@ catch(e) {
this.updateAeroPeekPreviewsTimer || this.updateAeroPeekPreviewsTimer ||
!('Win7Features' in window) || !('Win7Features' in window) ||
!window.Win7Features || !window.Win7Features ||
!Win7Features.onOpenWindow ||
!this.AeroPeek || !this.AeroPeek ||
!this.AeroPeek.windows !this.AeroPeek.windows
) )
@ -1553,8 +1552,14 @@ catch(e) {
this.updateAeroPeekPreviewsTimer = window.setTimeout(function(aSelf) { this.updateAeroPeekPreviewsTimer = window.setTimeout(function(aSelf) {
aSelf.updateAeroPeekPreviewsTimer = null; aSelf.updateAeroPeekPreviewsTimer = null;
aSelf.updateAeroPeekPreviewsInternal(); try {
}, 50, this); aSelf.updateAeroPeekPreviewsInternal();
}
catch(e) {
dump(e+'\n');
aSelf.updateAeroPeekPreviews();
}
}, 250, this);
}, },
updateAeroPeekPreviewsTimer : null, updateAeroPeekPreviewsTimer : null,
updateAeroPeekPreviewsInternal : function TSTService_updateAeroPeekPreviewsInternal() updateAeroPeekPreviewsInternal : function TSTService_updateAeroPeekPreviewsInternal()
@ -1564,9 +1569,8 @@ catch(e) {
aTabWindow.previews.forEach(function(aPreview) { aTabWindow.previews.forEach(function(aPreview) {
if (!aPreview) return; if (!aPreview) return;
var tab = aPreview.controller.wrappedJSObject.tab; var tab = aPreview.controller.wrappedJSObject.tab;
return aPreview.visible = tab.getAttribute(this.AeroPeek.__treestyletab__kCOLLAPSED) != 'true'; aPreview.visible = tab.getAttribute(this.kCOLLAPSED) != 'true';
}, this); }, this);
aTabWindow.updateTabOrdering();
this.AeroPeek.checkPreviewCount(); this.AeroPeek.checkPreviewCount();
return true; return true;
} }

View File

@ -273,43 +273,6 @@ var TreeStyleTabUtils = {
var ns = {}; var ns = {};
Components.utils.import('resource://gre/modules/WindowsPreviewPerTab.jsm', ns); Components.utils.import('resource://gre/modules/WindowsPreviewPerTab.jsm', ns);
this.AeroPeek = ns.AeroPeek; this.AeroPeek = ns.AeroPeek;
// don't override twice!
if (this.AeroPeek.__lookupGetter__('previews'))
return;
this.AeroPeek.__treestyletab__previews = this.AeroPeek.previews;
this.AeroPeek.__treestyletab__kCOLLAPSED = this.kCOLLAPSED;
this.AeroPeek.__defineGetter__('previews', function() {
var original = this.__treestyletab__previews;
// clean up the array (for unknown errors)
this.__treestyletab__previews = original = original.filter(function(aPreview) {
return aPreview;
});
// ignore collapsed tabs!
var filtered = original.filter(function(aPreview) {
var tab = aPreview.controller.wrappedJSObject.tab;
return aPreview.visible = tab.getAttribute(this.__treestyletab__kCOLLAPSED) != 'true';
});
filtered.push = function(aItem) {
original.push(aItem);
};
filtered.splice = function(aIndex, aLength, aInserted) {
var index = original.indexOf(filtered[aIndex]);
original.splice(index, aLength, aInserted);
};
filtered.forEach = function(aCallback, aThis) {
original.forEach(aCallback, aThis);
};
return filtered;
});
this.AeroPeek.__defineSetter__('previews', function(aValue) {
return this.__treestyletab__previews = aValue;
});
}, },
observe : function TSTUtils_observe(aSubject, aTopic, aData) observe : function TSTUtils_observe(aSubject, aTopic, aData)