From a856ba112fde07f8e6f8a8780bc6d96abc25dc34 Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Mon, 17 Sep 2012 23:41:05 +0900 Subject: [PATCH 1/2] Remove setting PseudoTreeBuilder.__proto__. Call TreeStyleTabUtils' methods directly. --- modules/pseudoTreeBuilder.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/pseudoTreeBuilder.js b/modules/pseudoTreeBuilder.js index bf08faf8..fb8877c1 100644 --- a/modules/pseudoTreeBuilder.js +++ b/modules/pseudoTreeBuilder.js @@ -41,7 +41,6 @@ const Ci = Components.interfaces; Components.utils.import('resource://treestyletab-modules/utils.js'); var PseudoTreeBuilder = { - __proto__ : TreeStyleTabUtils, kFAVICON : 'treestyletab-pseudo-tree-favicon', kROOTITEM : 'treestyletab-pseudo-tree-root-item', @@ -104,7 +103,7 @@ var PseudoTreeBuilder = { if (w.isBlankPageURL ? !w.isBlankPageURL(uri) : (uri != 'about:blank')) tooltip += '\n' + uri; label.setAttribute('tooltiptext', tooltip); label.setAttribute('class', 'text-link '+this.kTREEITEM); - label.setAttribute('tab-id', this.getTabValue(aTab, this.kID)); + label.setAttribute('tab-id', TreeStyleTabUtils.getTabValue(aTab, TreeStyleTabUtils.kID)); var children = this.createTabChildren(aTab); if (children) { @@ -122,7 +121,7 @@ var PseudoTreeBuilder = { { var doc = aTab.ownerDocument; - var children = this.getChildTabs(aTab); + var children = TreeStyleTabUtils.getChildTabs(aTab); if (!children.length) return null; From 6a5d12915e9b85a4138ce99cf4fa631467356e59 Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Mon, 17 Sep 2012 23:47:46 +0900 Subject: [PATCH 2/2] Use XPCOMUtils.defineLazyModuleGetter() to import |TreeStyleTabUtils| in modules/pseudoTreeBuilder.js. --- modules/pseudoTreeBuilder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/pseudoTreeBuilder.js b/modules/pseudoTreeBuilder.js index fb8877c1..5d63866f 100644 --- a/modules/pseudoTreeBuilder.js +++ b/modules/pseudoTreeBuilder.js @@ -38,7 +38,9 @@ const EXPORTED_SYMBOLS = ['PseudoTreeBuilder']; const Cc = Components.classes; const Ci = Components.interfaces; -Components.utils.import('resource://treestyletab-modules/utils.js'); +Components.utils.import('resource://gre/modules/XPCOMUtils.jsm'); + +XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabUtils', 'resource://treestyletab-modules/utils.js'); var PseudoTreeBuilder = {