| 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 22 matching lines...) Expand all Loading... |
| 33 #include "wtf/Forward.h" | 33 #include "wtf/Forward.h" |
| 34 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 35 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 struct FocusCandidate; | 39 struct FocusCandidate; |
| 40 struct FocusParams; | 40 struct FocusParams; |
| 41 class Document; | 41 class Document; |
| 42 class Element; | 42 class Element; |
| 43 class FocusChangedObserver; |
| 43 class Frame; | 44 class Frame; |
| 44 class HTMLFrameOwnerElement; | 45 class HTMLFrameOwnerElement; |
| 45 class InputDeviceCapabilities; | 46 class InputDeviceCapabilities; |
| 46 class LocalFrame; | 47 class LocalFrame; |
| 47 class Node; | 48 class Node; |
| 48 class Page; | 49 class Page; |
| 49 class RemoteFrame; | 50 class RemoteFrame; |
| 50 | 51 |
| 51 class CORE_EXPORT FocusController final | 52 class CORE_EXPORT FocusController final |
| 52 : public GarbageCollected<FocusController> { | 53 : public GarbageCollected<FocusController> { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None, | 87 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None, |
| 87 // |WebFocusTypeNone, and null InputDeviceCapabilities. | 88 // |WebFocusTypeNone, and null InputDeviceCapabilities. |
| 88 bool setFocusedElement(Element*, Frame*); | 89 bool setFocusedElement(Element*, Frame*); |
| 89 | 90 |
| 90 void setActive(bool); | 91 void setActive(bool); |
| 91 bool isActive() const { return m_isActive; } | 92 bool isActive() const { return m_isActive; } |
| 92 | 93 |
| 93 void setFocused(bool); | 94 void setFocused(bool); |
| 94 bool isFocused() const { return m_isFocused; } | 95 bool isFocused() const { return m_isFocused; } |
| 95 | 96 |
| 97 void registerFocusChangedObserver(FocusChangedObserver*); |
| 98 |
| 96 DECLARE_TRACE(); | 99 DECLARE_TRACE(); |
| 97 | 100 |
| 98 private: | 101 private: |
| 99 explicit FocusController(Page*); | 102 explicit FocusController(Page*); |
| 100 | 103 |
| 101 Element* findFocusableElement(WebFocusType, Element&); | 104 Element* findFocusableElement(WebFocusType, Element&); |
| 102 | 105 |
| 103 bool advanceFocus(WebFocusType, | 106 bool advanceFocus(WebFocusType, |
| 104 bool initialFocus, | 107 bool initialFocus, |
| 105 InputDeviceCapabilities* sourceCapabilities = nullptr); | 108 InputDeviceCapabilities* sourceCapabilities = nullptr); |
| 106 bool advanceFocusDirectionally(WebFocusType); | 109 bool advanceFocusDirectionally(WebFocusType); |
| 107 bool advanceFocusInDocumentOrder(LocalFrame*, | 110 bool advanceFocusInDocumentOrder(LocalFrame*, |
| 108 Element* start, | 111 Element* start, |
| 109 WebFocusType, | 112 WebFocusType, |
| 110 bool initialFocus, | 113 bool initialFocus, |
| 111 InputDeviceCapabilities* sourceCapabilities); | 114 InputDeviceCapabilities* sourceCapabilities); |
| 112 | 115 |
| 113 bool advanceFocusDirectionallyInContainer(Node* container, | 116 bool advanceFocusDirectionallyInContainer(Node* container, |
| 114 const LayoutRect& startingRect, | 117 const LayoutRect& startingRect, |
| 115 WebFocusType); | 118 WebFocusType); |
| 116 void findFocusCandidateInContainer(Node& container, | 119 void findFocusCandidateInContainer(Node& container, |
| 117 const LayoutRect& startingRect, | 120 const LayoutRect& startingRect, |
| 118 WebFocusType, | 121 WebFocusType, |
| 119 FocusCandidate& closest); | 122 FocusCandidate& closest); |
| 120 | 123 |
| 124 void notifyFocusChangedObservers() const; |
| 125 |
| 121 Member<Page> m_page; | 126 Member<Page> m_page; |
| 122 Member<Frame> m_focusedFrame; | 127 Member<Frame> m_focusedFrame; |
| 123 bool m_isActive; | 128 bool m_isActive; |
| 124 bool m_isFocused; | 129 bool m_isFocused; |
| 125 bool m_isChangingFocusedFrame; | 130 bool m_isChangingFocusedFrame; |
| 131 HeapHashSet<WeakMember<FocusChangedObserver>> m_focusChangedObservers; |
| 126 }; | 132 }; |
| 127 | 133 |
| 128 } // namespace blink | 134 } // namespace blink |
| 129 | 135 |
| 130 #endif // FocusController_h | 136 #endif // FocusController_h |
| OLD | NEW |