Changeset 859
- Timestamp:
- 2008-03-06 21:48:14 (9 months ago)
- Files:
-
- branches/1.0.x/chrome/content/dta/manager.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/chrome/content/dta/manager.js
r856 r859 1722 1722 this._chan.asyncOpen(this, null); 1723 1723 } 1724 1725 var Prompts = { 1726 _authPrompter: null, 1727 _prompter: null, 1728 get authPrompter() { 1729 if (!this._authPrompter) { 1730 this._authPrompter = WindowWatcherService.getNewAuthPrompter(window) 1731 .QueryInterface(Ci.nsIAuthPrompt); 1732 } 1733 return this._authPrompter; 1734 }, 1735 get prompter() { 1736 if (!this._prompter) { 1737 this._prompter = WindowWatcherService.getNewPrompter(window) 1738 .QueryInterface(Ci.nsIPrompt); 1739 } 1740 return this._prompter; 1741 } 1742 }; 1743 1724 1744 Connection.prototype = { 1725 1745 _interfaces: [ … … 1770 1790 // nsIInterfaceRequestor 1771 1791 getInterface: function DL_getInterface(iid) { 1772 if (this._interfaces.some(function(i) { return iid.equals(i); })) {1773 return this;1774 }1775 1792 if (iid.equals(Ci.nsIAuthPrompt)) { 1776 return this.authPrompter;1777 } 1793 return Prompts.authPrompter; 1794 } 1778 1795 if (iid.equals(Ci.nsIPrompt)) { 1779 return this.prompter; 1780 } 1781 throw Components.results.NS_ERROR_NO_INTERFACE; 1782 }, 1783 get authPrompter() { 1784 try { 1785 return WindowWatcherService.getNewAuthPrompter(window) 1786 .QueryInterface(Ci.nsIAuthPrompt); 1796 return Prompts.prompter; 1797 } 1798 // for 1.9 1799 /* this one makes minefield ask for the password again and again :p 1800 if ('nsIAuthPromptProvider' in Ci && iid.equals(Ci.nsIAuthPromptProvider)) { 1801 return Prompts.prompter.QueryInterface(Ci.nsIAuthPromptProvider); 1802 }*/ 1803 // for 1.9 1804 if ('nsIAuthPrompt2' in Ci && iid.equals(Ci.nsIAuthPrompt2)) { 1805 return Prompts.authPrompter.QueryInterface(Ci.nsIAuthPrompt2); 1806 } 1807 try { 1808 return this.QueryInterface(iid); 1787 1809 } 1788 1810 catch (ex) { 1789 Debug.log("authPrompter", ex); 1790 throw ex; 1791 } 1792 }, 1793 get prompter() { 1794 try { 1795 return WindowWatcherService.getNewPrompter(window) 1796 .QueryInterface(Ci.nsIPrompt); 1797 } 1798 catch (ex) { 1799 Debug.log("prompter", ex); 1811 Debug.log("interface not implemented: " + iid, ex); 1800 1812 throw ex; 1801 1813 }
