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

Unified Diff: Source/core/testing/InternalSettings.cpp

Issue 1118613002: Hook up Android closed captions 'enabled' setting to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed lgtm comment and rebased Created 5 years, 5 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 | « Source/core/testing/InternalSettings.h ('k') | Source/core/testing/InternalSettings.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/InternalSettings.cpp
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index d8be81d83a0cd79dc6ca77edd09f68f2d804aefd..69391751a85225422ded62965049d6988b1f52d8 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -291,6 +291,23 @@ void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height
settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
}
+void InternalSettings::setTextTrackKindUserPreference(const String& preference, ExceptionState& exceptionState)
+{
+ InternalSettingsGuardForSettings();
+ String token = preference.stripWhiteSpace();
+ TextTrackKindUserPreference userPreference = TextTrackKindUserPreference::Default;
+ if (token == "default")
+ userPreference = TextTrackKindUserPreference::Default;
+ else if (token == "captions")
+ userPreference = TextTrackKindUserPreference::Captions;
+ else if (token == "subtitles")
+ userPreference = TextTrackKindUserPreference::Subtitles;
+ else
+ exceptionState.throwDOMException(SyntaxError, "The user preference for text track kind " + preference + ")' is invalid.");
+
+ settings()->setTextTrackKindUserPreference(userPreference);
+}
+
void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionState& exceptionState)
{
InternalSettingsGuardForSettings();
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/core/testing/InternalSettings.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698