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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
31 #include "wtf/RefPtr.h" | 31 #include "wtf/RefPtr.h" |
32 #include "wtf/text/AtomicString.h" | 32 #include "wtf/text/AtomicString.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class Element; | 36 class Element; |
37 class Document; | 37 class Document; |
38 class Page; | 38 class Page; |
39 class PlatformMouseEvent; | 39 class WebMouseEvent; |
40 | 40 |
41 class CORE_EXPORT PointerLockController final | 41 class CORE_EXPORT PointerLockController final |
42 : public GarbageCollected<PointerLockController> { | 42 : public GarbageCollected<PointerLockController> { |
43 WTF_MAKE_NONCOPYABLE(PointerLockController); | 43 WTF_MAKE_NONCOPYABLE(PointerLockController); |
44 | 44 |
45 public: | 45 public: |
46 static PointerLockController* create(Page*); | 46 static PointerLockController* create(Page*); |
47 | 47 |
48 void requestPointerLock(Element* target); | 48 void requestPointerLock(Element* target); |
49 void requestPointerUnlock(); | 49 void requestPointerUnlock(); |
50 void elementRemoved(Element*); | 50 void elementRemoved(Element*); |
51 void documentDetached(Document*); | 51 void documentDetached(Document*); |
52 bool lockPending() const; | 52 bool lockPending() const; |
53 Element* element() const; | 53 Element* element() const; |
54 | 54 |
55 void didAcquirePointerLock(); | 55 void didAcquirePointerLock(); |
56 void didNotAcquirePointerLock(); | 56 void didNotAcquirePointerLock(); |
57 void didLosePointerLock(); | 57 void didLosePointerLock(); |
58 void dispatchLockedMouseEvent(const PlatformMouseEvent&, | 58 void dispatchLockedMouseEvent(const WebMouseEvent&, |
59 const AtomicString& eventType); | 59 const AtomicString& eventType); |
60 | 60 |
61 DECLARE_TRACE(); | 61 DECLARE_TRACE(); |
62 | 62 |
63 private: | 63 private: |
64 explicit PointerLockController(Page*); | 64 explicit PointerLockController(Page*); |
65 void clearElement(); | 65 void clearElement(); |
66 void enqueueEvent(const AtomicString& type, Element*); | 66 void enqueueEvent(const AtomicString& type, Element*); |
67 void enqueueEvent(const AtomicString& type, Document*); | 67 void enqueueEvent(const AtomicString& type, Document*); |
68 | 68 |
69 Member<Page> m_page; | 69 Member<Page> m_page; |
70 bool m_lockPending; | 70 bool m_lockPending; |
71 Member<Element> m_element; | 71 Member<Element> m_element; |
72 Member<Document> m_documentOfRemovedElementWhileWaitingForUnlock; | 72 Member<Document> m_documentOfRemovedElementWhileWaitingForUnlock; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
76 | 76 |
77 #endif // PointerLockController_h | 77 #endif // PointerLockController_h |
OLD | NEW |