From 22886df1924cefe1c7d4e806a8f9dd453e9fb7e2 Mon Sep 17 00:00:00 2001 From: Mark Capella Date: Tue, 8 May 2012 14:10:31 +0900 Subject: [PATCH] Bug 750287 - don't cache 'is form fill enabled' pref, r=surkov, f=tbsaunde --- accessible/src/base/nsAccessNode.cpp | 9 --------- accessible/src/base/nsAccessNode.h | 2 -- accessible/src/html/HTMLFormControlAccessible.cpp | 5 ++++- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 74e40f13b8b..e908728748d 100644 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -49,8 +49,6 @@ #include "nsIDOMWindow.h" #include "nsIFrame.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIPrefBranch.h" -#include "nsIPrefService.h" #include "nsIPresShell.h" #include "nsIServiceManager.h" #include "nsIStringBundle.h" @@ -66,8 +64,6 @@ using namespace mozilla::a11y; nsIStringBundle *nsAccessNode::gStringBundle = 0; -bool nsAccessNode::gIsFormFillEnabled = false; - ApplicationAccessible* nsAccessNode::gApplicationAccessible = nsnull; /* @@ -162,11 +158,6 @@ void nsAccessNode::InitXPAccessibility() stringBundleService->CreateBundle(ACCESSIBLE_BUNDLE_URL, &gStringBundle); } - - nsCOMPtr prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); - if (prefBranch) { - prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled); - } } void nsAccessNode::ShutdownXPAccessibility() diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index 0ca25b5bf76..fc05de4e266 100644 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -167,8 +167,6 @@ protected: // Static data, we do our own refcounting for our static data. static nsIStringBundle* gStringBundle; - static bool gIsFormFillEnabled; - private: nsAccessNode() MOZ_DELETE; nsAccessNode(const nsAccessNode&) MOZ_DELETE; diff --git a/accessible/src/html/HTMLFormControlAccessible.cpp b/accessible/src/html/HTMLFormControlAccessible.cpp index 807ff3de68b..35afd61323f 100644 --- a/accessible/src/html/HTMLFormControlAccessible.cpp +++ b/accessible/src/html/HTMLFormControlAccessible.cpp @@ -63,6 +63,9 @@ #include "nsIServiceManager.h" #include "nsITextControlFrame.h" +#include "mozilla/Preferences.h" + +using namespace mozilla; using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// @@ -496,7 +499,7 @@ HTMLTextFieldAccessible::NativeState() // No parent can mean a fake widget created for XUL textbox. If accessible // is unattached from tree then we don't care. - if (mParent && gIsFormFillEnabled) { + if (mParent && Preferences::GetBool("browser.formfill.enable")) { // Check to see if autocompletion is allowed on this input. We don't expose // it for password fields even though the entire password can be remembered // for a page if the user asks it to be. However, the kind of autocomplete