Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java

Issue 941353002: [Android] Decouple AccessibilityInjector from WebContentsObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java
index 25b722d7ecae6938d7cc25028cfcf9d364101540..d07c4931dfb152ea992b1ae7d7e0052a1d153ba3 100644
--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java
@@ -20,7 +20,6 @@ import org.apache.http.client.utils.URLEncodedUtils;
import org.chromium.base.CommandLine;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.JavascriptInterface;
-import org.chromium.content.browser.WebContentsObserver;
import org.chromium.content.common.ContentSwitches;
import org.json.JSONException;
import org.json.JSONObject;
@@ -34,7 +33,7 @@ import java.util.List;
/**
* Responsible for accessibility injection and management of a {@link ContentViewCore}.
*/
-public class AccessibilityInjector extends WebContentsObserver {
+public class AccessibilityInjector {
// The ContentView this injector is responsible for managing.
protected ContentViewCore mContentViewCore;
@@ -103,7 +102,6 @@ public class AccessibilityInjector extends WebContentsObserver {
* @param view The ContentViewCore that this AccessibilityInjector manages.
*/
protected AccessibilityInjector(ContentViewCore view) {
- super(view.getWebContents());
mContentViewCore = view;
mAccessibilityScreenReaderUrl = CommandLine.getInstance().getSwitchValue(
@@ -208,13 +206,15 @@ public class AccessibilityInjector extends WebContentsObserver {
* accessibility script as not being injected. This way we can properly ignore incoming
* accessibility gesture events.
*/
- @Override
- public void didStartLoading(String url) {
+ public void onPageLoadStarted() {
mScriptInjected = false;
}
- @Override
- public void didStopLoading(String url) {
+ /**
+ * Notifies this handler that a page load has stopped, which means we can now inject the
+ * accessibility script.
+ */
+ public void onPageLoadStopped() {
injectAccessibilityScriptIntoPage();
}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698