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

Side by Side Diff: public/platform/Platform.h

Issue 15724023: Vibration API: use runtime flag, change from client to platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 6 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/modules/vibration/VibrationClient.h ('k') | no next file » | 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Delayed work is driven by a shared timer. 379 // Delayed work is driven by a shared timer.
380 typedef void (*SharedTimerFunction)(); 380 typedef void (*SharedTimerFunction)();
381 virtual void setSharedTimerFiredFunction(SharedTimerFunction timerFunction) { } 381 virtual void setSharedTimerFiredFunction(SharedTimerFunction timerFunction) { }
382 virtual void setSharedTimerFireInterval(double) { } 382 virtual void setSharedTimerFireInterval(double) { }
383 virtual void stopSharedTimer() { } 383 virtual void stopSharedTimer() { }
384 384
385 // Callable from a background WebKit thread. 385 // Callable from a background WebKit thread.
386 virtual void callOnMainThread(void (*func)(void*), void* context) { } 386 virtual void callOnMainThread(void (*func)(void*), void* context) { }
387 387
388 388
389 // Vibration -----------------------------------------------------------
390
391 // Starts a vibration for the given duration in milliseconds. If there is cu rrently an active
392 // vibration it will be cancelled before the new one is started.
393 virtual void vibrate(unsigned time) { }
394
395 // Cancels the current vibration, if there is one.
396 virtual void cancelVibration() { }
397
398
389 // Testing ------------------------------------------------------------- 399 // Testing -------------------------------------------------------------
390 400
391 #define HAVE_WEBUNITTESTSUPPORT 1 401 #define HAVE_WEBUNITTESTSUPPORT 1
392 // Get a pointer to testing support interfaces. Will not be available in pro duction builds. 402 // Get a pointer to testing support interfaces. Will not be available in pro duction builds.
393 virtual WebUnitTestSupport* unitTestSupport() { return 0; } 403 virtual WebUnitTestSupport* unitTestSupport() { return 0; }
394 404
395 405
396 // Tracing ------------------------------------------------------------- 406 // Tracing -------------------------------------------------------------
397 407
398 // Get a pointer to the enabled state of the given trace category. The 408 // Get a pointer to the enabled state of the given trace category. The
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 // If null, the platform stops providing device motion data to the current l istener. 536 // If null, the platform stops providing device motion data to the current l istener.
527 virtual void setDeviceMotionListener(WebKit::WebDeviceMotionListener*) { } 537 virtual void setDeviceMotionListener(WebKit::WebDeviceMotionListener*) { }
528 538
529 protected: 539 protected:
530 virtual ~Platform() { } 540 virtual ~Platform() { }
531 }; 541 };
532 542
533 } // namespace WebKit 543 } // namespace WebKit
534 544
535 #endif 545 #endif
OLDNEW
« no previous file with comments | « Source/modules/vibration/VibrationClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698