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

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

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698