| 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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/FocusDirection.h" | 29 #include "core/page/FocusDirection.h" |
| 30 #include "core/platform/graphics/LayoutRect.h" | 30 #include "core/platform/graphics/LayoutRect.h" |
| 31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
| 32 #include "wtf/NonNullPtr.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 { |
| 50 public: | 51 public: |
| 51 Node* rootNode() const; | 52 Node* rootNode() const; |
| 52 Element* owner() const; | 53 Element* owner() const; |
| 53 static FocusNavigationScope focusNavigationScopeOf(Node*); | 54 static FocusNavigationScope focusNavigationScopeOf(Node*); |
| 54 static FocusNavigationScope ownedByNonFocusableFocusScopeOwner(Node*); | 55 static FocusNavigationScope ownedByNonFocusableFocusScopeOwner(Node*); |
| 55 static FocusNavigationScope ownedByShadowHost(Node*); | 56 static FocusNavigationScope ownedByShadowHost(Node*); |
| 56 static FocusNavigationScope ownedByShadowInsertionPoint(HTMLShadowElement*); | 57 static FocusNavigationScope ownedByShadowInsertionPoint(HTMLShadowElement*); |
| 57 static FocusNavigationScope ownedByIFrame(HTMLFrameOwnerElement*); | 58 static FocusNavigationScope ownedByIFrame(HTMLFrameOwnerElement*); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 explicit FocusNavigationScope(TreeScope*); | 61 explicit FocusNavigationScope(NonNullPtr<TreeScope>); |
| 61 TreeScope* m_rootTreeScope; | 62 NonNullPtr<TreeScope> m_rootTreeScope; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 class FocusController { | 65 class FocusController { |
| 65 WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED; | 66 WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED; |
| 66 public: | 67 public: |
| 67 static PassOwnPtr<FocusController> create(Page*); | 68 static PassOwnPtr<FocusController> create(Page*); |
| 68 | 69 |
| 69 void setFocusedFrame(PassRefPtr<Frame>); | 70 void setFocusedFrame(PassRefPtr<Frame>); |
| 70 Frame* focusedFrame() const { return m_focusedFrame.get(); } | 71 Frame* focusedFrame() const { return m_focusedFrame.get(); } |
| 71 Frame* focusedOrMainFrame() const; | 72 Frame* focusedOrMainFrame() const; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 bool m_isActive; | 120 bool m_isActive; |
| 120 bool m_isFocused; | 121 bool m_isFocused; |
| 121 bool m_isChangingFocusedFrame; | 122 bool m_isChangingFocusedFrame; |
| 122 bool m_containingWindowIsVisible; | 123 bool m_containingWindowIsVisible; |
| 123 | 124 |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 } // namespace WebCore | 127 } // namespace WebCore |
| 127 | 128 |
| 128 #endif // FocusController_h | 129 #endif // FocusController_h |
| OLD | NEW |