OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #ifndef Platform_h | 31 #ifndef Platform_h |
32 #define Platform_h | 32 #define Platform_h |
33 | 33 |
34 #ifdef WIN32 | 34 #ifdef WIN32 |
35 #include <windows.h> | 35 #include <windows.h> |
36 #endif | 36 #endif |
37 | 37 |
38 #include "WebAudioDevice.h" | 38 #include "WebAudioDevice.h" |
| 39 #include "WebCallbacks.h" |
39 #include "WebCommon.h" | 40 #include "WebCommon.h" |
| 41 #include "WebDOMException.h" |
40 #include "WebData.h" | 42 #include "WebData.h" |
41 #include "WebGamepadListener.h" | 43 #include "WebGamepadListener.h" |
42 #include "WebGamepads.h" | 44 #include "WebGamepads.h" |
43 #include "WebGraphicsContext3D.h" | 45 #include "WebGraphicsContext3D.h" |
44 #include "WebLocalizedString.h" | 46 #include "WebLocalizedString.h" |
45 #include "WebScreenOrientationLockType.h" | 47 #include "WebScreenOrientationLockType.h" |
| 48 #include "WebScreenOrientationType.h" |
46 #include "WebSpeechSynthesizer.h" | 49 #include "WebSpeechSynthesizer.h" |
47 #include "WebStorageQuotaCallbacks.h" | 50 #include "WebStorageQuotaCallbacks.h" |
48 #include "WebStorageQuotaType.h" | 51 #include "WebStorageQuotaType.h" |
49 #include "WebString.h" | 52 #include "WebString.h" |
50 #include "WebURLError.h" | 53 #include "WebURLError.h" |
51 #include "WebVector.h" | 54 #include "WebVector.h" |
52 | 55 |
53 class GrContext; | 56 class GrContext; |
54 | 57 |
55 namespace blink { | 58 namespace blink { |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 // If null, the platform stops providing device orientation data to the curr
ent listener. | 628 // If null, the platform stops providing device orientation data to the curr
ent listener. |
626 virtual void setDeviceOrientationListener(blink::WebDeviceOrientationListene
r*) { } | 629 virtual void setDeviceOrientationListener(blink::WebDeviceOrientationListene
r*) { } |
627 | 630 |
628 // Sets a Listener to listen for device light data updates. | 631 // Sets a Listener to listen for device light data updates. |
629 // If null, the platform stops providing device light data to the current li
stener. | 632 // If null, the platform stops providing device light data to the current li
stener. |
630 virtual void setDeviceLightListener(blink::WebDeviceLightListener*) { } | 633 virtual void setDeviceLightListener(blink::WebDeviceLightListener*) { } |
631 | 634 |
632 | 635 |
633 // Screen Orientation ------------------------------------------------- | 636 // Screen Orientation ------------------------------------------------- |
634 | 637 |
| 638 typedef WebCallbacks<blink::WebScreenOrientationType, blink::WebDOMException
> WebLockOrientationCallback; |
635 virtual void setScreenOrientationListener(blink::WebScreenOrientationListene
r*) { } | 639 virtual void setScreenOrientationListener(blink::WebScreenOrientationListene
r*) { } |
636 virtual void lockOrientation(WebScreenOrientationLockType) { } | 640 virtual void lockOrientation(WebScreenOrientationLockType) { } |
| 641 // Request a screen orientation lock and pass a |callback| object to be used |
| 642 // to notify of success/failure. The |callback| parameter is expected to be |
| 643 // owned by the implementation. |
| 644 virtual void lockOrientation(WebScreenOrientationLockType, WebLockOrientatio
nCallback* callback) |
| 645 { |
| 646 delete callback; // prevents memory leak if there is no implementation. |
| 647 } |
637 virtual void unlockOrientation() { } | 648 virtual void unlockOrientation() { } |
638 | 649 |
639 | 650 |
640 // Quota ----------------------------------------------------------- | 651 // Quota ----------------------------------------------------------- |
641 | 652 |
642 // Queries the storage partition's storage usage and quota information. | 653 // Queries the storage partition's storage usage and quota information. |
643 // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called | 654 // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called |
644 // with the current usage and quota information for the partition. When | 655 // with the current usage and quota information for the partition. When |
645 // an error occurs WebStorageQuotaCallbacks::didFail is called with an | 656 // an error occurs WebStorageQuotaCallbacks::didFail is called with an |
646 // error code. | 657 // error code. |
647 virtual void queryStorageUsageAndQuota( | 658 virtual void queryStorageUsageAndQuota( |
648 const WebURL& storagePartition, | 659 const WebURL& storagePartition, |
649 WebStorageQuotaType, | 660 WebStorageQuotaType, |
650 WebStorageQuotaCallbacks) { } | 661 WebStorageQuotaCallbacks) { } |
651 | 662 |
652 | 663 |
653 // WebDatabase -------------------------------------------------------- | 664 // WebDatabase -------------------------------------------------------- |
654 | 665 |
655 virtual WebDatabaseObserver* databaseObserver() { return 0; } | 666 virtual WebDatabaseObserver* databaseObserver() { return 0; } |
656 | 667 |
657 | 668 |
658 protected: | 669 protected: |
659 virtual ~Platform() { } | 670 virtual ~Platform() { } |
660 }; | 671 }; |
661 | 672 |
662 } // namespace blink | 673 } // namespace blink |
663 | 674 |
664 #endif | 675 #endif |
OLD | NEW |