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

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

Issue 283423005: Use Promises for screen.lockOrientation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review commenst Created 6 years, 7 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
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 24 matching lines...) Expand all
35 #include <windows.h> 35 #include <windows.h>
36 #endif 36 #endif
37 37
38 #include "WebAudioDevice.h" 38 #include "WebAudioDevice.h"
39 #include "WebCommon.h" 39 #include "WebCommon.h"
40 #include "WebData.h" 40 #include "WebData.h"
41 #include "WebGamepadListener.h" 41 #include "WebGamepadListener.h"
42 #include "WebGamepads.h" 42 #include "WebGamepads.h"
43 #include "WebGraphicsContext3D.h" 43 #include "WebGraphicsContext3D.h"
44 #include "WebLocalizedString.h" 44 #include "WebLocalizedString.h"
45 #include "WebLockOrientationCallback.h"
45 #include "WebScreenOrientationLockType.h" 46 #include "WebScreenOrientationLockType.h"
47 #include "WebScreenOrientationType.h"
46 #include "WebSpeechSynthesizer.h" 48 #include "WebSpeechSynthesizer.h"
47 #include "WebStorageQuotaCallbacks.h" 49 #include "WebStorageQuotaCallbacks.h"
48 #include "WebStorageQuotaType.h" 50 #include "WebStorageQuotaType.h"
49 #include "WebString.h" 51 #include "WebString.h"
50 #include "WebURLError.h" 52 #include "WebURLError.h"
51 #include "WebVector.h" 53 #include "WebVector.h"
52 54
53 class GrContext; 55 class GrContext;
54 56
55 namespace blink { 57 namespace blink {
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 629
628 // Sets a Listener to listen for device light data updates. 630 // 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. 631 // If null, the platform stops providing device light data to the current li stener.
630 virtual void setDeviceLightListener(blink::WebDeviceLightListener*) { } 632 virtual void setDeviceLightListener(blink::WebDeviceLightListener*) { }
631 633
632 634
633 // Screen Orientation ------------------------------------------------- 635 // Screen Orientation -------------------------------------------------
634 636
635 virtual void setScreenOrientationListener(blink::WebScreenOrientationListene r*) { } 637 virtual void setScreenOrientationListener(blink::WebScreenOrientationListene r*) { }
636 virtual void lockOrientation(WebScreenOrientationLockType) { } 638 virtual void lockOrientation(WebScreenOrientationLockType) { }
639 // Request a screen orientation lock and pass a |callback| object to be used
640 // to notify of success/failure. The |callback| parameter is expected to be
641 // owned by the implementation.
642 virtual void lockOrientation(WebScreenOrientationLockType, WebLockOrientatio nCallback* callback)
643 {
644 delete callback; // prevents memory leak if there is no implementation.
645 }
637 virtual void unlockOrientation() { } 646 virtual void unlockOrientation() { }
638 647
639 648
640 // Quota ----------------------------------------------------------- 649 // Quota -----------------------------------------------------------
641 650
642 // Queries the storage partition's storage usage and quota information. 651 // Queries the storage partition's storage usage and quota information.
643 // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called 652 // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called
644 // with the current usage and quota information for the partition. When 653 // with the current usage and quota information for the partition. When
645 // an error occurs WebStorageQuotaCallbacks::didFail is called with an 654 // an error occurs WebStorageQuotaCallbacks::didFail is called with an
646 // error code. 655 // error code.
647 virtual void queryStorageUsageAndQuota( 656 virtual void queryStorageUsageAndQuota(
648 const WebURL& storagePartition, 657 const WebURL& storagePartition,
649 WebStorageQuotaType, 658 WebStorageQuotaType,
650 WebStorageQuotaCallbacks) { } 659 WebStorageQuotaCallbacks) { }
651 660
652 661
653 // WebDatabase -------------------------------------------------------- 662 // WebDatabase --------------------------------------------------------
654 663
655 virtual WebDatabaseObserver* databaseObserver() { return 0; } 664 virtual WebDatabaseObserver* databaseObserver() { return 0; }
656 665
657 666
658 protected: 667 protected:
659 virtual ~Platform() { } 668 virtual ~Platform() { }
660 }; 669 };
661 670
662 } // namespace blink 671 } // namespace blink
663 672
664 #endif 673 #endif
OLDNEW
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.idl ('k') | public/platform/WebLockOrientationCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698