that's weird something prototyped in nsAccessibilityService gets defined in nsApplicationAccessibleWrap. I can't think of better place but you should XXX comment in prototype I think
::: accessible/src/base/nsAccessibilityService.h
@@ +57,5 @@
> FocusManager* FocusMgr();
>
> +/**
> + * Is platform accessibility enabled.
> + * only used on linux with atk for now.
nit: o -> O
@@ +61,5 @@
> + * only used on linux with atk for now.
> + */
> +#ifdef MOZ_ACCESSIBILITY_ATK
> +bool ShouldA11yBeEnabled();
> +#endif
Comment on attachment 572700
patch with nits fixed
Review of attachment 572700: ------- ------- ------- ------- ------- ------- ------- ------- --
-------
I'm not looking into the platform specific logic since I bet you did that well, just integration part.
canceling review until comments are addressed
::: accessible/ src/atk/ nsApplicationAc cessibleWrap. cpp cessibleWrap: :Init() abled() ) {
@@ +612,4 @@
> bool
> nsApplicationAc
> {
> + if (ShouldA11yBeEn
if application accessible is initialized then accessibility must be enabled. What's a reason of this check?
@@ +862,5 @@
> return NS_OK;
> }
> +
> +namespace mozilla {
> + namespace a11y {
nit: no indent for a11y namespace
@@ +865,5 @@ abled()
> +namespace mozilla {
> + namespace a11y {
> +
> +bool
> +ShouldA11yBeEn
that's weird something prototyped in nsAccessibility Service gets defined in nsApplicationAc cessibleWrap. I can't think of better place but you should XXX comment in prototype I think
@@ +869,5 @@ abled()
> +ShouldA11yBeEn
> +{
> + static bool sChecked = false, sShouldEnable = false;
> + if (sChecked)
> + return sShouldEnable;
that's ok but curious why wouldn't use enum instead?
@@ +928,5 @@
> + default:
> + break;
> + }
> +
> + dbus_done:
goto is unusual style and it's not appreciated in c++ world in general. I'm fine if you're sure to keep it
@@ +955,5 @@ sSysPrefService , &rv); >GetBoolPref( sAccessibilityK ey, &sShouldEnable);
> + do_GetService(
> + if (NS_SUCCEEDED(rv) && sysPrefService)
> + sysPrefService-
> +
> + return sShouldEnable;
nit: wrong indentation
::: accessible/ src/base/ nsAccessibility Service. h
@@ +57,5 @@
> FocusManager* FocusMgr();
>
> +/**
> + * Is platform accessibility enabled.
> + * only used on linux with atk for now.
nit: o -> O
@@ +61,5 @@ TY_ATK bled();
> + * only used on linux with atk for now.
> + */
> +#ifdef MOZ_ACCESSIBILI
> +bool ShouldA11yBeEna
> +#endif
nit: put comment into #ifdef please
::: widget/ src/gtk2/ nsWindow. cpp
@@ +6479,1 @@
> return;
it appears nsWindow::Show() manages root accessible creation, so here you should check only if accessibility service instantiated.
and then you have unique consumer of ShouldA11yBeEnabled (nsWindow::Show), maybe it's worth to keep this method somewhere in gtk2 code