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

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: Rebase and addressed lgtm nits 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
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.");
philipj_slow 2015/07/09 15:34:09 This should also return, otherwise we'll still cal
srivats 2015/07/09 21:25:37 Since userPreference is initialized to Default, if
philipj_slow 2015/07/09 22:36:26 I don't think continuing the execution after throw
+
+ settings()->setTextTrackKindUserPreference(userPreference);
+}
+
void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionState& exceptionState)
{
InternalSettingsGuardForSettings();

Powered by Google App Engine
This is Rietveld 408576698