Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.h

Issue 1704333002: Do not use Node in FocusController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split a CL Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // one of its descendant frames, is currently focused. 63 // one of its descendant frames, is currently focused.
64 HTMLFrameOwnerElement* focusedFrameOwnerElement(LocalFrame& currentFrame) co nst; 64 HTMLFrameOwnerElement* focusedFrameOwnerElement(LocalFrame& currentFrame) co nst;
65 65
66 // Determines whether the provided Document has focus according to 66 // Determines whether the provided Document has focus according to
67 // http://www.w3.org/TR/html5/editing.html#dom-document-hasfocus 67 // http://www.w3.org/TR/html5/editing.html#dom-document-hasfocus
68 bool isDocumentFocused(const Document&) const; 68 bool isDocumentFocused(const Document&) const;
69 69
70 bool setInitialFocus(WebFocusType); 70 bool setInitialFocus(WebFocusType);
71 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); } 71 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); }
72 bool advanceFocusAcrossFrames(WebFocusType, RemoteFrame* from, LocalFrame* t o, InputDeviceCapabilities* sourceCapabilities = nullptr); 72 bool advanceFocusAcrossFrames(WebFocusType, RemoteFrame* from, LocalFrame* t o, InputDeviceCapabilities* sourceCapabilities = nullptr);
73 Element* findFocusableElement(WebFocusType, Node&); 73 Element* findFocusableElementInShadowHost(const Element& shadowHost);
74 74
75 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, const FocusP arams&); 75 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, const FocusP arams&);
76 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None, 76 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None,
77 // |WebFocusTypeNone, and null InputDeviceCapabilities. 77 // |WebFocusTypeNone, and null InputDeviceCapabilities.
78 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>); 78 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>);
79 79
80 void setActive(bool); 80 void setActive(bool);
81 bool isActive() const { return m_isActive; } 81 bool isActive() const { return m_isActive; }
82 82
83 void setFocused(bool); 83 void setFocused(bool);
84 bool isFocused() const { return m_isFocused; } 84 bool isFocused() const { return m_isFocused; }
85 85
86 DECLARE_TRACE(); 86 DECLARE_TRACE();
87 87
88 private: 88 private:
89 explicit FocusController(Page*); 89 explicit FocusController(Page*);
90 90
91 Element* findFocusableElement(WebFocusType, Element&);
92
91 bool advanceFocus(WebFocusType, bool initialFocus, InputDeviceCapabilities* sourceCapabilities = nullptr); 93 bool advanceFocus(WebFocusType, bool initialFocus, InputDeviceCapabilities* sourceCapabilities = nullptr);
92 bool advanceFocusDirectionally(WebFocusType); 94 bool advanceFocusDirectionally(WebFocusType);
93 bool advanceFocusInDocumentOrder(LocalFrame*, Node* startingNode, WebFocusTy pe, bool initialFocus, InputDeviceCapabilities* sourceCapabilities); 95 bool advanceFocusInDocumentOrder(LocalFrame*, Node* startingNode, WebFocusTy pe, bool initialFocus, InputDeviceCapabilities* sourceCapabilities);
94 96
95 bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect& startingRect, WebFocusType); 97 bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect& startingRect, WebFocusType);
96 void findFocusCandidateInContainer(Node& container, const LayoutRect& starti ngRect, WebFocusType, FocusCandidate& closest); 98 void findFocusCandidateInContainer(Node& container, const LayoutRect& starti ngRect, WebFocusType, FocusCandidate& closest);
97 99
98 RawPtrWillBeMember<Page> m_page; 100 RawPtrWillBeMember<Page> m_page;
99 RefPtrWillBeMember<Frame> m_focusedFrame; 101 RefPtrWillBeMember<Frame> m_focusedFrame;
100 bool m_isActive; 102 bool m_isActive;
101 bool m_isFocused; 103 bool m_isFocused;
102 bool m_isChangingFocusedFrame; 104 bool m_isChangingFocusedFrame;
103 }; 105 };
104 106
105 } // namespace blink 107 } // namespace blink
106 108
107 #endif // FocusController_h 109 #endif // FocusController_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698