From a5ba3af523df74801cbe062028821511ef9be168 Mon Sep 17 00:00:00 2001 From: gasolin Date: Mon, 2 May 2016 22:17:00 -0700 Subject: [PATCH] Bug 522668 - support check and fix place database in about:support; r=adw MozReview-Commit-ID: 8HTyEnBN5oJ --- toolkit/content/aboutSupport.js | 10 +++++++++ toolkit/content/aboutSupport.xhtml | 21 +++++++++++++++++++ .../en-US/chrome/global/aboutSupport.dtd | 4 ++++ toolkit/themes/shared/aboutSupport.css | 5 +++++ 4 files changed, 40 insertions(+) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index a6a6c3a888ce..04847937ed1e 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -14,6 +14,8 @@ Cu.import("resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PlacesDBUtils", + "resource://gre/modules/PlacesDBUtils.jsm"); window.addEventListener("load", function onload(event) { try { @@ -920,4 +922,12 @@ function setupEventListeners(){ safeModeRestart(); } }); + $("verify-place-integrity-button").addEventListener("click", function (event){ + PlacesDBUtils.checkAndFixDatabase(function(aLog) { + let msg = aLog.join("\n"); + $("verify-place-result").style.display = "block"; + $("verify-place-result").classList.remove("no-copy"); + $("verify-place-result").textContent = msg; + }); + }); } diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index 0e5986d230b1..9928a0b3ab26 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -406,6 +406,27 @@ + + +

+ &aboutSupport.placeDatabaseTitle; +

+ + + + + + + +
+ &aboutSupport.placeDatabaseIntegrity; + + + +
+

&aboutSupport.jsTitle; diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd index d4467729c5c2..4ea1d42db3cf 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd @@ -89,6 +89,10 @@ variant of aboutSupport.showDir.label. --> + + + + diff --git a/toolkit/themes/shared/aboutSupport.css b/toolkit/themes/shared/aboutSupport.css index 590c190ec152..87525ee7ee50 100644 --- a/toolkit/themes/shared/aboutSupport.css +++ b/toolkit/themes/shared/aboutSupport.css @@ -117,6 +117,11 @@ td { display: block; } +#verify-place-result { + max-height: 200px; + overflow: auto; +} + .block { display: block; }