OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser.accessibility; | 5 package org.chromium.content.browser.accessibility; |
6 | 6 |
7 import android.accessibilityservice.AccessibilityServiceInfo; | 7 import android.accessibilityservice.AccessibilityServiceInfo; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
10 import android.os.Build; | 10 import android.os.Build; |
11 import android.os.Bundle; | 11 import android.os.Bundle; |
12 import android.os.Vibrator; | 12 import android.os.Vibrator; |
13 import android.speech.tts.TextToSpeech; | 13 import android.speech.tts.TextToSpeech; |
14 import android.util.Log; | 14 import android.util.Log; |
15 import android.view.View; | 15 import android.view.View; |
16 import android.view.accessibility.AccessibilityManager; | 16 import android.view.accessibility.AccessibilityManager; |
17 import android.view.accessibility.AccessibilityNodeInfo; | 17 import android.view.accessibility.AccessibilityNodeInfo; |
18 | 18 |
19 import com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient; | 19 import com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient; |
20 import com.googlecode.eyesfree.braille.selfbraille.WriteData; | 20 import com.googlecode.eyesfree.braille.selfbraille.WriteData; |
21 | 21 |
22 import org.apache.http.NameValuePair; | 22 import org.apache.http.NameValuePair; |
23 import org.apache.http.client.utils.URLEncodedUtils; | 23 import org.apache.http.client.utils.URLEncodedUtils; |
24 import org.chromium.base.CommandLine; | 24 import org.chromium.base.CommandLine; |
25 import org.chromium.content.browser.ContentViewCore; | 25 import org.chromium.content.browser.ContentViewCore; |
26 import org.chromium.content.browser.JavascriptInterface; | 26 import org.chromium.content.browser.JavascriptInterface; |
27 import org.chromium.content.browser.WebContentsObserverAndroid; | 27 import org.chromium.content.browser.WebContentsObserver; |
28 import org.chromium.content.common.ContentSwitches; | 28 import org.chromium.content.common.ContentSwitches; |
29 import org.json.JSONException; | 29 import org.json.JSONException; |
30 import org.json.JSONObject; | 30 import org.json.JSONObject; |
31 | 31 |
32 import java.net.URI; | 32 import java.net.URI; |
33 import java.net.URISyntaxException; | 33 import java.net.URISyntaxException; |
34 import java.util.HashMap; | 34 import java.util.HashMap; |
35 import java.util.Iterator; | 35 import java.util.Iterator; |
36 import java.util.List; | 36 import java.util.List; |
37 | 37 |
38 /** | 38 /** |
39 * Responsible for accessibility injection and management of a {@link ContentVie
wCore}. | 39 * Responsible for accessibility injection and management of a {@link ContentVie
wCore}. |
40 */ | 40 */ |
41 public class AccessibilityInjector extends WebContentsObserverAndroid { | 41 public class AccessibilityInjector extends WebContentsObserver { |
42 private static final String TAG = "AccessibilityInjector"; | 42 private static final String TAG = "AccessibilityInjector"; |
43 | 43 |
44 // The ContentView this injector is responsible for managing. | 44 // The ContentView this injector is responsible for managing. |
45 protected ContentViewCore mContentViewCore; | 45 protected ContentViewCore mContentViewCore; |
46 | 46 |
47 // The Java objects that are exposed to JavaScript | 47 // The Java objects that are exposed to JavaScript |
48 private TextToSpeechWrapper mTextToSpeech; | 48 private TextToSpeechWrapper mTextToSpeech; |
49 private VibratorWrapper mVibrator; | 49 private VibratorWrapper mVibrator; |
50 private final boolean mHasVibratePermission; | 50 private final boolean mHasVibratePermission; |
51 | 51 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 462 } |
463 } | 463 } |
464 | 464 |
465 @SuppressWarnings("unused") | 465 @SuppressWarnings("unused") |
466 protected void shutdownInternal() { | 466 protected void shutdownInternal() { |
467 mTextToSpeech.shutdown(); | 467 mTextToSpeech.shutdown(); |
468 mSelfBrailleClient.shutdown(); | 468 mSelfBrailleClient.shutdown(); |
469 } | 469 } |
470 } | 470 } |
471 } | 471 } |
OLD | NEW |