OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // blink::WebScreenOrientationClient implementation. | 38 // blink::WebScreenOrientationClient implementation. |
39 virtual void lockOrientation( | 39 virtual void lockOrientation( |
40 blink::WebScreenOrientationLockType orientation, | 40 blink::WebScreenOrientationLockType orientation, |
41 blink::WebLockOrientationCallback* callback) OVERRIDE; | 41 blink::WebLockOrientationCallback* callback) OVERRIDE; |
42 virtual void unlockOrientation() OVERRIDE; | 42 virtual void unlockOrientation() OVERRIDE; |
43 | 43 |
44 void OnLockSuccess(int request_id, | 44 void OnLockSuccess(int request_id, |
45 unsigned angle, | 45 unsigned angle, |
46 blink::WebScreenOrientationType orientation); | 46 blink::WebScreenOrientationType orientation); |
47 void OnLockError(int request_id, | 47 void OnLockError(int request_id, |
48 blink::WebLockOrientationCallback::ErrorType error); | 48 blink::WebLockOrientationError error); |
49 | 49 |
50 void CancelPendingLocks(); | 50 void CancelPendingLocks(); |
51 | 51 |
52 // The pending_callbacks_ map is mostly meant to have a unique ID to associate | 52 // The pending_callbacks_ map is mostly meant to have a unique ID to associate |
53 // with every callback going trough the dispatcher. The map will own the | 53 // with every callback going trough the dispatcher. The map will own the |
54 // pointer in the sense that it will destroy it when Remove() will be called. | 54 // pointer in the sense that it will destroy it when Remove() will be called. |
55 // Furthermore, we only expect to have one callback at a time in this map, | 55 // Furthermore, we only expect to have one callback at a time in this map, |
56 // which is what IDMap was designed for. | 56 // which is what IDMap was designed for. |
57 typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap; | 57 typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap; |
58 CallbackMap pending_callbacks_; | 58 CallbackMap pending_callbacks_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); | 60 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace content | 63 } // namespace content |
64 | 64 |
65 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ | 65 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_ |
OLD | NEW |