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

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

Issue 1132053005: Make KitkatCaptioningBridge a singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused singleton Created 5 years, 7 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 | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/captioning/CaptioningBridgeFactory.java » ('j') | 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/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 2ebfb8e79e70afba5d5de45144274eafaf540c7d..ce60e73c82cc4f10cfc839890d4f90da81ebf07c 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -97,8 +97,9 @@ import java.util.Map.Entry;
* being tied to the view system.
*/
@JNINamespace("content")
-public class ContentViewCore
- implements AccessibilityStateChangeListener, ScreenOrientationObserver {
+public class ContentViewCore implements
+ AccessibilityStateChangeListener, ScreenOrientationObserver,
+ SystemCaptioningBridge.SystemCaptioningBridgeListener {
private static final String TAG = "ContentViewCore";
@@ -631,7 +632,7 @@ public class ContentViewCore
mRenderCoordinates.setDeviceScaleFactor(deviceScaleFactor);
mAccessibilityManager = (AccessibilityManager)
getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
- mSystemCaptioningBridge = CaptioningBridgeFactory.create(this);
+ mSystemCaptioningBridge = CaptioningBridgeFactory.getSystemCaptioningBridge(mContext);
mGestureStateListeners = new ObserverList<GestureStateListener>();
mGestureStateListenersIterator = mGestureStateListeners.rewindableIterator();
@@ -1475,7 +1476,7 @@ public class ContentViewCore
ScreenOrientationListener.getInstance().addObserver(this, mContext);
GamepadList.onAttachedToWindow(mContext);
mAccessibilityManager.addAccessibilityStateChangeListener(this);
- mSystemCaptioningBridge.registerBridge();
+ mSystemCaptioningBridge.addListener(this);
}
/**
@@ -1498,7 +1499,7 @@ public class ContentViewCore
// locking and app switching.
setTextHandlesTemporarilyHidden(true);
hidePopupsAndPreserveSelection();
- mSystemCaptioningBridge.unregisterBridge();
+ mSystemCaptioningBridge.removeListener(this);
}
/**
@@ -2602,7 +2603,7 @@ public class ContentViewCore
private void onRenderProcessChange() {
attachImeAdapter();
// Immediately sync closed caption settings to the new render process.
- mSystemCaptioningBridge.syncToDelegate();
+ mSystemCaptioningBridge.syncToListener(this);
}
/**
@@ -2910,13 +2911,9 @@ public class ContentViewCore
return null;
}
- /**
- * Set closed captioning text track style settings.
- *
- * @param settings The TextTrackSettings object containing the new settings.
- */
@TargetApi(Build.VERSION_CODES.KITKAT)
- public void setTextTrackSettings(TextTrackSettings settings) {
+ @Override
+ public void onSystemCaptioningChanged(TextTrackSettings settings) {
if (mNativeContentViewCore == 0) return;
nativeSetTextTrackSettings(mNativeContentViewCore, settings.getTextTrackBackgroundColor(),
settings.getTextTrackFontFamily(), settings.getTextTrackFontStyle(),
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/captioning/CaptioningBridgeFactory.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698