OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple 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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef FocusController_h | 26 #ifndef FocusController_h |
27 #define FocusController_h | 27 #define FocusController_h |
28 | 28 |
29 #include "core/page/FocusType.h" | 29 #include "core/page/FocusType.h" |
30 #include "heap/Handle.h" | |
wibling-chromium
2014/04/24 14:43:06
NIT: please -> "platform/heap/Handle.h"
Mads Ager (chromium)
2014/04/25 10:58:25
Done.
| |
30 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
31 #include "wtf/Forward.h" | 32 #include "wtf/Forward.h" |
32 #include "wtf/Noncopyable.h" | 33 #include "wtf/Noncopyable.h" |
33 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
37 struct FocusCandidate; | 38 struct FocusCandidate; |
38 class Document; | 39 class Document; |
39 class Element; | 40 class Element; |
40 class Frame; | 41 class Frame; |
41 class HTMLFrameOwnerElement; | 42 class HTMLFrameOwnerElement; |
42 class HTMLShadowElement; | 43 class HTMLShadowElement; |
43 class IntRect; | 44 class IntRect; |
44 class KeyboardEvent; | 45 class KeyboardEvent; |
45 class Node; | 46 class Node; |
46 class Page; | 47 class Page; |
47 class TreeScope; | 48 class TreeScope; |
48 | 49 |
49 class FocusNavigationScope { | 50 class FocusNavigationScope { |
51 STACK_ALLOCATED(); | |
50 public: | 52 public: |
51 Node* rootNode() const; | 53 Node* rootNode() const; |
52 Element* owner() const; | 54 Element* owner() const; |
53 static FocusNavigationScope focusNavigationScopeOf(Node*); | 55 static FocusNavigationScope focusNavigationScopeOf(Node*); |
54 static FocusNavigationScope ownedByNonFocusableFocusScopeOwner(Node*); | 56 static FocusNavigationScope ownedByNonFocusableFocusScopeOwner(Node*); |
55 static FocusNavigationScope ownedByShadowHost(Node*); | 57 static FocusNavigationScope ownedByShadowHost(Node*); |
56 static FocusNavigationScope ownedByShadowInsertionPoint(HTMLShadowElement*); | 58 static FocusNavigationScope ownedByShadowInsertionPoint(HTMLShadowElement*); |
57 static FocusNavigationScope ownedByIFrame(HTMLFrameOwnerElement*); | 59 static FocusNavigationScope ownedByIFrame(HTMLFrameOwnerElement*); |
58 | 60 |
59 private: | 61 private: |
60 explicit FocusNavigationScope(TreeScope*); | 62 explicit FocusNavigationScope(TreeScope*); |
61 TreeScope* m_rootTreeScope; | 63 RawPtrWillBeMember<TreeScope> m_rootTreeScope; |
62 }; | 64 }; |
63 | 65 |
64 class FocusController { | 66 class FocusController { |
65 WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED; | 67 WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED; |
66 public: | 68 public: |
67 static PassOwnPtr<FocusController> create(Page*); | 69 static PassOwnPtr<FocusController> create(Page*); |
68 | 70 |
69 void setFocusedFrame(PassRefPtr<Frame>); | 71 void setFocusedFrame(PassRefPtr<Frame>); |
70 void focusDocumentView(PassRefPtr<Frame>); | 72 void focusDocumentView(PassRefPtr<Frame>); |
71 Frame* focusedFrame() const { return m_focusedFrame.get(); } | 73 Frame* focusedFrame() const { return m_focusedFrame.get(); } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 Page* m_page; | 117 Page* m_page; |
116 RefPtr<Frame> m_focusedFrame; | 118 RefPtr<Frame> m_focusedFrame; |
117 bool m_isActive; | 119 bool m_isActive; |
118 bool m_isFocused; | 120 bool m_isFocused; |
119 bool m_isChangingFocusedFrame; | 121 bool m_isChangingFocusedFrame; |
120 }; | 122 }; |
121 | 123 |
122 } // namespace WebCore | 124 } // namespace WebCore |
123 | 125 |
124 #endif // FocusController_h | 126 #endif // FocusController_h |
OLD | NEW |