OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 TextTrackKindUserPreference userPreference = | 309 TextTrackKindUserPreference userPreference = |
310 TextTrackKindUserPreference::Default; | 310 TextTrackKindUserPreference::Default; |
311 if (token == "default") | 311 if (token == "default") |
312 userPreference = TextTrackKindUserPreference::Default; | 312 userPreference = TextTrackKindUserPreference::Default; |
313 else if (token == "captions") | 313 else if (token == "captions") |
314 userPreference = TextTrackKindUserPreference::Captions; | 314 userPreference = TextTrackKindUserPreference::Captions; |
315 else if (token == "subtitles") | 315 else if (token == "subtitles") |
316 userPreference = TextTrackKindUserPreference::Subtitles; | 316 userPreference = TextTrackKindUserPreference::Subtitles; |
317 else | 317 else |
318 exceptionState.throwDOMException( | 318 exceptionState.throwDOMException( |
319 SyntaxError, "The user preference for text track kind " + preference + | 319 SyntaxError, |
320 ")' is invalid."); | 320 "The user preference for text track kind " + preference + |
| 321 ")' is invalid."); |
321 | 322 |
322 settings()->setTextTrackKindUserPreference(userPreference); | 323 settings()->setTextTrackKindUserPreference(userPreference); |
323 } | 324 } |
324 | 325 |
325 void InternalSettings::setMediaTypeOverride(const String& mediaType, | 326 void InternalSettings::setMediaTypeOverride(const String& mediaType, |
326 ExceptionState& exceptionState) { | 327 ExceptionState& exceptionState) { |
327 InternalSettingsGuardForSettings(); | 328 InternalSettingsGuardForSettings(); |
328 settings()->setMediaTypeOverride(mediaType); | 329 settings()->setMediaTypeOverride(mediaType); |
329 } | 330 } |
330 | 331 |
331 void InternalSettings::setAccessibilityFontScaleFactor( | 332 void InternalSettings::setAccessibilityFontScaleFactor( |
332 float fontScaleFactor, | 333 float fontScaleFactor, |
333 ExceptionState& exceptionState) { | 334 ExceptionState& exceptionState) { |
334 InternalSettingsGuardForSettings(); | 335 InternalSettingsGuardForSettings(); |
335 settings()->setAccessibilityFontScaleFactor(fontScaleFactor); | 336 settings()->setAccessibilityFontScaleFactor(fontScaleFactor); |
336 } | 337 } |
337 | 338 |
338 void InternalSettings::setEditingBehavior(const String& editingBehavior, | 339 void InternalSettings::setEditingBehavior(const String& editingBehavior, |
339 ExceptionState& exceptionState) { | 340 ExceptionState& exceptionState) { |
340 InternalSettingsGuardForSettings(); | 341 InternalSettingsGuardForSettings(); |
341 if (equalIgnoringCase(editingBehavior, "win")) | 342 if (equalIgnoringCase(editingBehavior, "win")) |
342 settings()->setEditingBehaviorType(EditingWindowsBehavior); | 343 settings()->setEditingBehaviorType(EditingWindowsBehavior); |
343 else if (equalIgnoringCase(editingBehavior, "mac")) | 344 else if (equalIgnoringCase(editingBehavior, "mac")) |
344 settings()->setEditingBehaviorType(EditingMacBehavior); | 345 settings()->setEditingBehaviorType(EditingMacBehavior); |
345 else if (equalIgnoringCase(editingBehavior, "unix")) | 346 else if (equalIgnoringCase(editingBehavior, "unix")) |
346 settings()->setEditingBehaviorType(EditingUnixBehavior); | 347 settings()->setEditingBehaviorType(EditingUnixBehavior); |
347 else if (equalIgnoringCase(editingBehavior, "android")) | 348 else if (equalIgnoringCase(editingBehavior, "android")) |
348 settings()->setEditingBehaviorType(EditingAndroidBehavior); | 349 settings()->setEditingBehaviorType(EditingAndroidBehavior); |
349 else | 350 else |
350 exceptionState.throwDOMException( | 351 exceptionState.throwDOMException(SyntaxError, |
351 SyntaxError, "The editing behavior type provided ('" + editingBehavior + | 352 "The editing behavior type provided ('" + |
352 "') is invalid."); | 353 editingBehavior + "') is invalid."); |
353 } | 354 } |
354 | 355 |
355 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled) { | 356 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled) { |
356 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled); | 357 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(enabled); |
357 } | 358 } |
358 | 359 |
359 void InternalSettings::setImagesEnabled(bool enabled, | 360 void InternalSettings::setImagesEnabled(bool enabled, |
360 ExceptionState& exceptionState) { | 361 ExceptionState& exceptionState) { |
361 InternalSettingsGuardForSettings(); | 362 InternalSettingsGuardForSettings(); |
362 settings()->setImagesEnabled(enabled); | 363 settings()->setImagesEnabled(enabled); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 RuntimeEnabledFeatures::setCompositorWorkerEnabled(enabled); | 527 RuntimeEnabledFeatures::setCompositorWorkerEnabled(enabled); |
527 } | 528 } |
528 | 529 |
529 void InternalSettings::setPresentationReceiver(bool enabled, | 530 void InternalSettings::setPresentationReceiver(bool enabled, |
530 ExceptionState& exceptionState) { | 531 ExceptionState& exceptionState) { |
531 InternalSettingsGuardForSettings(); | 532 InternalSettingsGuardForSettings(); |
532 settings()->setPresentationReceiver(enabled); | 533 settings()->setPresentationReceiver(enabled); |
533 } | 534 } |
534 | 535 |
535 } // namespace blink | 536 } // namespace blink |
OLD | NEW |