| 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 21 matching lines...) Expand all Loading... |
| 32 #include "public/platform/WebFocusType.h" | 32 #include "public/platform/WebFocusType.h" |
| 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 class Element; | 40 class Element; |
| 41 class Frame; | 41 class Frame; |
| 42 class HTMLFrameOwnerElement; |
| 42 class InputDeviceCapabilities; | 43 class InputDeviceCapabilities; |
| 43 class LocalFrame; | 44 class LocalFrame; |
| 44 class Node; | 45 class Node; |
| 45 class Page; | 46 class Page; |
| 46 | 47 |
| 47 class CORE_EXPORT FocusController final : public NoBaseWillBeGarbageCollectedFin
alized<FocusController> { | 48 class CORE_EXPORT FocusController final : public NoBaseWillBeGarbageCollectedFin
alized<FocusController> { |
| 48 WTF_MAKE_NONCOPYABLE(FocusController); USING_FAST_MALLOC_WILL_BE_REMOVED(Foc
usController); | 49 WTF_MAKE_NONCOPYABLE(FocusController); USING_FAST_MALLOC_WILL_BE_REMOVED(Foc
usController); |
| 49 public: | 50 public: |
| 50 static PassOwnPtrWillBeRawPtr<FocusController> create(Page*); | 51 static PassOwnPtrWillBeRawPtr<FocusController> create(Page*); |
| 51 | 52 |
| 52 void setFocusedFrame(PassRefPtrWillBeRawPtr<Frame>); | 53 void setFocusedFrame(PassRefPtrWillBeRawPtr<Frame>); |
| 53 void focusDocumentView(PassRefPtrWillBeRawPtr<Frame>); | 54 void focusDocumentView(PassRefPtrWillBeRawPtr<Frame>); |
| 54 LocalFrame* focusedFrame() const; | 55 LocalFrame* focusedFrame() const; |
| 55 Frame* focusedOrMainFrame() const; | 56 Frame* focusedOrMainFrame() const; |
| 56 | 57 |
| 58 // Finds the focused HTMLFrameOwnerElement, if any, in the provided frame. |
| 59 // An HTMLFrameOwnerElement is considered focused if the frame it owns, or |
| 60 // one of its descendant frames, is currently focused. |
| 61 HTMLFrameOwnerElement* focusedFrameOwnerElement(LocalFrame& currentFrame) co
nst; |
| 62 |
| 57 bool setInitialFocus(WebFocusType); | 63 bool setInitialFocus(WebFocusType); |
| 58 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili
ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); } | 64 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili
ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); } |
| 59 Element* findFocusableElement(WebFocusType, Node&); | 65 Element* findFocusableElement(WebFocusType, Node&); |
| 60 | 66 |
| 61 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, WebFocusType
= WebFocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr); | 67 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, WebFocusType
= WebFocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr); |
| 62 | 68 |
| 63 void setActive(bool); | 69 void setActive(bool); |
| 64 bool isActive() const { return m_isActive; } | 70 bool isActive() const { return m_isActive; } |
| 65 | 71 |
| 66 void setFocused(bool); | 72 void setFocused(bool); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 81 RawPtrWillBeMember<Page> m_page; | 87 RawPtrWillBeMember<Page> m_page; |
| 82 RefPtrWillBeMember<Frame> m_focusedFrame; | 88 RefPtrWillBeMember<Frame> m_focusedFrame; |
| 83 bool m_isActive; | 89 bool m_isActive; |
| 84 bool m_isFocused; | 90 bool m_isFocused; |
| 85 bool m_isChangingFocusedFrame; | 91 bool m_isChangingFocusedFrame; |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 } // namespace blink | 94 } // namespace blink |
| 89 | 95 |
| 90 #endif // FocusController_h | 96 #endif // FocusController_h |
| OLD | NEW |