const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;

Cu.import('resource://gre/modules/XPCOMUtils.jsm');

function AboutAppCenter() { }
AboutAppCenter.prototype = {
  classDescription: 'App center page about:appcenter',
  contractID: '@mozilla.org/network/protocol/about;1?what=appcenter',
  classID: Components.ID('3f20418f-20d4-48bb-b242-b72c36e465ae'),
  QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),

  getURIFlags: function(aURI) {
    return (Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT |
        Ci.nsIAboutModule.ALLOW_SCRIPT);
  },

  newChannel: function(aURI) {
    var ios = Cc['@mozilla.org/network/io-service;1']
                .getService(Ci.nsIIOService);
    var home = 'chrome://livemargins/content/appcenter.xul';
    var channel = ios.newChannel(home, null, null);
    channel.originalURI = aURI;
    return channel;
  }
};

const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutAppCenter]);
