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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // ("on-demand,none"). | 450 // ("on-demand,none"). |
451 Vector<String> tokens; | 451 Vector<String> tokens; |
452 types.split(",", false, tokens); | 452 types.split(",", false, tokens); |
453 | 453 |
454 int hoverTypes = 0; | 454 int hoverTypes = 0; |
455 for (size_t i = 0; i < tokens.size(); ++i) { | 455 for (size_t i = 0; i < tokens.size(); ++i) { |
456 String token = tokens[i].stripWhiteSpace(); | 456 String token = tokens[i].stripWhiteSpace(); |
457 | 457 |
458 if (token == "none") | 458 if (token == "none") |
459 hoverTypes |= HoverTypeNone; | 459 hoverTypes |= HoverTypeNone; |
460 else if (token == "on-demand") | |
461 hoverTypes |= HoverTypeOnDemand; | |
462 else if (token == "hover") | 460 else if (token == "hover") |
463 hoverTypes |= HoverTypeHover; | 461 hoverTypes |= HoverTypeHover; |
464 else | 462 else |
465 exceptionState.throwDOMException( | 463 exceptionState.throwDOMException( |
466 SyntaxError, "The hover type token ('" + token + ")' is invalid."); | 464 SyntaxError, "The hover type token ('" + token + ")' is invalid."); |
467 } | 465 } |
468 | 466 |
469 settings()->setAvailableHoverTypes(hoverTypes); | 467 settings()->setAvailableHoverTypes(hoverTypes); |
470 } | 468 } |
471 | 469 |
472 void InternalSettings::setPrimaryHoverType(const String& type, | 470 void InternalSettings::setPrimaryHoverType(const String& type, |
473 ExceptionState& exceptionState) { | 471 ExceptionState& exceptionState) { |
474 InternalSettingsGuardForSettings(); | 472 InternalSettingsGuardForSettings(); |
475 String token = type.stripWhiteSpace(); | 473 String token = type.stripWhiteSpace(); |
476 | 474 |
477 HoverType hoverType = HoverTypeNone; | 475 HoverType hoverType = HoverTypeNone; |
478 if (token == "none") | 476 if (token == "none") |
479 hoverType = HoverTypeNone; | 477 hoverType = HoverTypeNone; |
480 else if (token == "on-demand") | |
481 hoverType = HoverTypeOnDemand; | |
482 else if (token == "hover") | 478 else if (token == "hover") |
483 hoverType = HoverTypeHover; | 479 hoverType = HoverTypeHover; |
484 else | 480 else |
485 exceptionState.throwDOMException( | 481 exceptionState.throwDOMException( |
486 SyntaxError, "The hover type token ('" + token + ")' is invalid."); | 482 SyntaxError, "The hover type token ('" + token + ")' is invalid."); |
487 | 483 |
488 settings()->setPrimaryHoverType(hoverType); | 484 settings()->setPrimaryHoverType(hoverType); |
489 } | 485 } |
490 | 486 |
491 void InternalSettings::setImageAnimationPolicy(const String& policy, | 487 void InternalSettings::setImageAnimationPolicy(const String& policy, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 RuntimeEnabledFeatures::setCompositorWorkerEnabled(enabled); | 522 RuntimeEnabledFeatures::setCompositorWorkerEnabled(enabled); |
527 } | 523 } |
528 | 524 |
529 void InternalSettings::setPresentationReceiver(bool enabled, | 525 void InternalSettings::setPresentationReceiver(bool enabled, |
530 ExceptionState& exceptionState) { | 526 ExceptionState& exceptionState) { |
531 InternalSettingsGuardForSettings(); | 527 InternalSettingsGuardForSettings(); |
532 settings()->setPresentationReceiver(enabled); | 528 settings()->setPresentationReceiver(enabled); |
533 } | 529 } |
534 | 530 |
535 } // namespace blink | 531 } // namespace blink |
OLD | NEW |