* @param view The ContentViewCore that this AccessibilityInjector manages.
*/
protected AccessibilityInjector(ContentViewCore view) {
- super(view);
+ super(view.getWebContents());
mContentViewCore = view;
mAccessibilityScreenReaderUrl = CommandLine.getInstance().getSwitchValue(
}
private int getAxsUrlParameterValue() {
- if (mContentViewCore.getUrl() == null) return ACCESSIBILITY_SCRIPT_INJECTION_UNDEFINED;
+ if (mContentViewCore.getWebContents().getUrl() == null) {
+ return ACCESSIBILITY_SCRIPT_INJECTION_UNDEFINED;
+ }
try {
- List<NameValuePair> params = URLEncodedUtils.parse(new URI(mContentViewCore.getUrl()),
- null);
+ List<NameValuePair> params = URLEncodedUtils.parse(
+ new URI(mContentViewCore.getWebContents().getUrl()), null);
for (NameValuePair param : params) {
if ("axs".equals(param.getName())) {
}
}
} catch (URISyntaxException ex) {
+ // Intentional no-op.
} catch (NumberFormatException ex) {
+ // Intentional no-op.
} catch (IllegalArgumentException ex) {
+ // Intentional no-op.
}
return ACCESSIBILITY_SCRIPT_INJECTION_UNDEFINED;
private static class VibratorWrapper {
private static final long MAX_VIBRATE_DURATION_MS = 5000;
- private Vibrator mVibrator;
+ private final Vibrator mVibrator;
public VibratorWrapper(Context context) {
mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
* Used to protect the TextToSpeech class, only exposing the methods we want to expose.
*/
private static class TextToSpeechWrapper {
- private TextToSpeech mTextToSpeech;
- private SelfBrailleClient mSelfBrailleClient;
- private View mView;
+ private final TextToSpeech mTextToSpeech;
+ private final SelfBrailleClient mSelfBrailleClient;
+ private final View mView;
public TextToSpeechWrapper(View view, Context context) {
mView = view;