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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 InternalSettingsGuardForSettings(); | 470 InternalSettingsGuardForSettings(); |
471 settings()->setTimeWithoutMouseMovementBeforeHidingControls(time); | 471 settings()->setTimeWithoutMouseMovementBeforeHidingControls(time); |
472 } | 472 } |
473 | 473 |
474 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec) | 474 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec) |
475 { | 475 { |
476 InternalSettingsGuardForSettings(); | 476 InternalSettingsGuardForSettings(); |
477 settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled); | 477 settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled); |
478 } | 478 } |
479 | 479 |
480 void InternalSettings::setPrimaryPointerDevices(const String& pointerDevice, Exc eptionCode& ec) | |
481 { | |
482 InternalSettingsGuardForSettings(); | |
483 settings()->setPrimaryPointerDevices(PointerDeviceUnknown); | |
484 | |
485 // Allow setting multiple devices by passing comma seperated list ("mouse,to uch") | |
486 size_t ix = 0; | |
487 size_t comma_position; | |
488 do { | |
489 comma_position = pointerDevice.find(',', ix); | |
Rick Byers
2013/04/10 14:57:51
Is there any other code here or in WTF somewhere f
bokan
2013/04/10 16:03:29
Done, replaced with WTFString::split
| |
490 | |
491 String value; | |
492 if(comma_position == notFound) | |
493 value = pointerDevice.substring(ix); | |
494 else | |
495 value = pointerDevice.substring(ix, comma_position-ix); | |
496 | |
497 ix = comma_position+1; | |
498 | |
499 if (value == "mouse") | |
500 settings()->setPrimaryPointerDevices(settings()->primaryPointerDevices () | PointerDeviceMouse); | |
501 else if (value == "touch") | |
502 settings()->setPrimaryPointerDevices(settings()->primaryPointerDevices () | PointerDeviceTouch); | |
503 else if (value == "none") | |
504 settings()->setPrimaryPointerDevices(settings()->primaryPointerDevices () | PointerDeviceNone); | |
505 else if (value == "unknown") | |
506 settings()->setPrimaryPointerDevices(settings()->primaryPointerDevices () | PointerDeviceUnknown); | |
507 else { | |
508 ec = SYNTAX_ERR; | |
509 return; | |
510 } | |
511 } while(comma_position != notFound && ix < pointerDevice.length()); | |
480 } | 512 } |
513 | |
514 } | |
OLD | NEW |