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

Side by Side Diff: Source/WebCore/testing/InternalSettings.cpp

Issue 13818030: Added primary input devices setting to blink to allow media queries for hover/pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 years, 8 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 unified diff | Download patch
« no previous file with comments | « Source/WebCore/testing/InternalSettings.h ('k') | Source/WebCore/testing/InternalSettings.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 InternalSettingsGuardForSettings(); 455 InternalSettingsGuardForSettings();
456 settings()->setTimeWithoutMouseMovementBeforeHidingControls(time); 456 settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
457 } 457 }
458 458
459 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec) 459 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
460 { 460 {
461 InternalSettingsGuardForSettings(); 461 InternalSettingsGuardForSettings();
462 settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled); 462 settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
463 } 463 }
464 464
465 void InternalSettings::setPrimaryPointerDevices(const String& pointerDevice, Exc eptionCode& ec)
466 {
467 InternalSettingsGuardForSettings();
468
469 // Allow setting multiple devices by passing comma seperated list ("mouse,to uch")
470 Vector<String> deviceTokens;
471 pointerDevice.split(",", false, deviceTokens);
472
473 int pointerDevices = PointerDeviceUnknown;
474 for(size_t i = 0; i < deviceTokens.size(); ++i) {
475 String token = deviceTokens[i].stripWhiteSpace();
476
477 if (token == "mouse")
478 pointerDevices |= PointerDeviceMouse;
479 else if (token == "touch")
480 pointerDevices |= PointerDeviceTouch;
481 else if (token == "none")
482 pointerDevices |= PointerDeviceNone;
483 else if (token == "unknown")
484 pointerDevices |= PointerDeviceUnknown;
485 else {
486 ec = SYNTAX_ERR;
487 return;
488 }
489 }
490
491 settings()->setPrimaryPointerDevices(pointerDevices);
465 } 492 }
493
494 }
OLDNEW
« no previous file with comments | « Source/WebCore/testing/InternalSettings.h ('k') | Source/WebCore/testing/InternalSettings.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698