Bug 1258450 - Route setAccessibilityEnabled through GeckoInterface. r=snorp,jchen

MozReview-Commit-ID: 9DXQ8mxtg2Q

--HG--
extra : rebase_source : 2576493a4fc0155d575963436e37361ef79936b8
extra : source : 7a434b18855a9439a98480a2261509ab5596f315
This commit is contained in:
Nick Alexander 2016-03-30 10:21:29 -07:00
parent 69ad3a1408
commit 912d1a7b9e
4 changed files with 12 additions and 8 deletions

View File

@ -156,4 +156,9 @@ public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
public void setUriTitle(final String uri, final String title) {
// By default, no titles are associated with URIs.
}
@Override
public void setAccessibilityEnabled(boolean enabled) {
// By default, take no action when accessibility is toggled on or off.
}
}

View File

@ -1375,6 +1375,7 @@ public class BrowserApp extends GeckoApp
@Override
public void setAccessibilityEnabled(boolean enabled) {
super.setAccessibilityEnabled(enabled);
mDynamicToolbar.setAccessibilityEnabled(enabled);
}

View File

@ -91,15 +91,11 @@ public class GeckoAccessibility {
@Override
public void onPostExecute(Void args) {
boolean isGeckoApp = false;
try {
isGeckoApp = context instanceof GeckoApp;
} catch (NoClassDefFoundError ex) {}
if (isGeckoApp) {
// Disable the dynamic toolbar when enabling accessibility.
// These features tend not to interact well.
((GeckoApp) context).setAccessibilityEnabled(sEnabled);
final GeckoAppShell.GeckoInterface geckoInterface = GeckoAppShell.getGeckoInterface();
if (geckoInterface == null) {
return;
}
geckoInterface.setAccessibilityEnabled(sEnabled);
}
}.execute();
}

View File

@ -2128,6 +2128,8 @@ public class GeckoAppShell
* @param title to associate with the given URI.
*/
public void setUriTitle(final String uri, final String title);
public void setAccessibilityEnabled(boolean enabled);
};
private static GeckoInterface sGeckoInterface;