Commit 6f75f8a3 authored by Jared Wein's avatar Jared Wein
Browse files

Bug 1548463 - Base page for HTML-based login manager. r=MattN,flod

Differential Revision: https://phabricator.services.mozilla.com/D29624

--HG--
extra : moz-landing-system : lando
parent afc359bd
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1747,6 +1747,7 @@ pref("extensions.pocket.site", "getpocket.com");
pref("signon.schemeUpgrades", true);
pref("signon.schemeUpgrades", true);
pref("signon.privateBrowsingCapture.enabled", true);
pref("signon.privateBrowsingCapture.enabled", true);
pref("signon.showAutoCompleteFooter", true);
pref("signon.showAutoCompleteFooter", true);
pref("signon.management.page.enabled", false);


// Enable the "Simplify Page" feature in Print Preview. This feature
// Enable the "Simplify Page" feature in Print Preview. This feature
// is disabled by default in toolkit.
// is disabled by default in toolkit.
+20 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,23 @@ let ACTORS = {
};
};


let LEGACY_ACTORS = {
let LEGACY_ACTORS = {
  AboutLogins: {
    child: {
      matches: ["about:logins"],
      module: "resource:///actors/AboutLoginsChild.jsm",
      events: {
        "AboutLoginsDeleteLogin": {wantUntrusted: true},
        "AboutLoginsInit": {wantUntrusted: true},
      },
      messages: [
        "AboutLogins:AllLogins",
        "AboutLogins:LoginAdded",
        "AboutLogins:LoginModified",
        "AboutLogins:LoginRemoved",
      ],
    },
  },

  AboutReader: {
  AboutReader: {
    child: {
    child: {
      module: "resource:///actors/AboutReaderChild.jsm",
      module: "resource:///actors/AboutReaderChild.jsm",
@@ -448,6 +465,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {


// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars
XPCOMUtils.defineLazyModuleGetters(this, {
XPCOMUtils.defineLazyModuleGetters(this, {
  AboutLoginsParent: "resource:///modules/AboutLoginsParent.jsm",
  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
  ContentClick: "resource:///modules/ContentClick.jsm",
  ContentClick: "resource:///modules/ContentClick.jsm",
  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
@@ -526,6 +544,8 @@ const listeners = {
  },
  },


  mm: {
  mm: {
    "AboutLogins:DeleteLogin": ["AboutLoginsParent"],
    "AboutLogins:Subscribe": ["AboutLoginsParent"],
    "Content:Click": ["ContentClick"],
    "Content:Click": ["ContentClick"],
    "ContentSearch": ["ContentSearch"],
    "ContentSearch": ["ContentSearch"],
    "FormValidation:ShowPopup": ["FormValidationHandler"],
    "FormValidation:ShowPopup": ["FormValidationHandler"],
+16 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@ namespace browser {
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)


bool AboutRedirector::sNewTabPageEnabled = false;
bool AboutRedirector::sNewTabPageEnabled = false;
bool AboutRedirector::sAboutLoginsEnabled = false;


static const uint32_t ACTIVITY_STREAM_FLAGS =
static const uint32_t ACTIVITY_STREAM_FLAGS =
    nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::ENABLE_INDEXED_DB |
    nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::ENABLE_INDEXED_DB |
@@ -56,6 +57,10 @@ static const RedirEntry kRedirMap[] = {
    {"framecrashed", "chrome://browser/content/aboutFrameCrashed.html",
    {"framecrashed", "chrome://browser/content/aboutFrameCrashed.html",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
    {"logins", "chrome://browser/content/aboutlogins/aboutLogins.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGED_CHILD |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT},
    {"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml",
    {"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
         nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
@@ -147,6 +152,13 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
    sNTPEnabledCacheInited = true;
    sNTPEnabledCacheInited = true;
  }
  }


  static bool sAboutLoginsCacheInited = false;
  if (!sAboutLoginsCacheInited) {
    Preferences::AddBoolVarCache(&AboutRedirector::sAboutLoginsEnabled,
                                 "signon.management.page.enabled");
    sAboutLoginsCacheInited = true;
  }

  for (auto& redir : kRedirMap) {
  for (auto& redir : kRedirMap) {
    if (!strcmp(path.get(), redir.id)) {
    if (!strcmp(path.get(), redir.id)) {
      nsAutoCString url;
      nsAutoCString url;
@@ -162,6 +174,10 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
        NS_ENSURE_SUCCESS(rv, rv);
        NS_ENSURE_SUCCESS(rv, rv);
      }
      }


      if (!sAboutLoginsEnabled && path.EqualsLiteral("logins")) {
        return NS_ERROR_NOT_AVAILABLE;
      }

      if (path.EqualsLiteral("welcome")) {
      if (path.EqualsLiteral("welcome")) {
        nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
        nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
            do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
            do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
+1 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ class AboutRedirector : public nsIAboutModule {
  virtual ~AboutRedirector() {}
  virtual ~AboutRedirector() {}


 private:
 private:
  static bool sAboutLoginsEnabled;
  static bool sNewTabPageEnabled;
  static bool sNewTabPageEnabled;
};
};


+1 −0
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@ pages = [
    'framecrashed',
    'framecrashed',
    'home',
    'home',
    'library',
    'library',
    'logins',
    'newinstall',
    'newinstall',
    'newtab',
    'newtab',
    'pocket-saved',
    'pocket-saved',
Loading