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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.h

Issue 2702273004: bindings: Simplifies WindowProxyManager and its relation to Frame. (Closed)
Patch Set: Fixed WindowProxyManager::createWindowProxy(ForFrame). Created 3 years, 9 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999-2001 Lars Knoll <knoll@kde.org> 3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> 4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> 5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org> 6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
9 * reserved. 9 * reserved.
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class FrameHost; 47 class FrameHost;
48 class FrameOwner; 48 class FrameOwner;
49 class HTMLFrameOwnerElement; 49 class HTMLFrameOwnerElement;
50 class LayoutPart; 50 class LayoutPart;
51 class LayoutPartItem; 51 class LayoutPartItem;
52 class KURL; 52 class KURL;
53 class Page; 53 class Page;
54 class SecurityContext; 54 class SecurityContext;
55 class Settings; 55 class Settings;
56 class WindowProxy; 56 class WindowProxy;
57 class WindowProxyManagerBase; 57 class WindowProxyManager;
58 struct FrameLoadRequest; 58 struct FrameLoadRequest;
59 59
60 enum class FrameDetachType { Remove, Swap }; 60 enum class FrameDetachType { Remove, Swap };
61 61
62 // Status of user gesture. 62 // Status of user gesture.
63 enum class UserGestureStatus { Active, None }; 63 enum class UserGestureStatus { Active, None };
64 64
65 // Frame is the base class of LocalFrame and RemoteFrame and should only contain 65 // Frame is the base class of LocalFrame and RemoteFrame and should only contain
66 // functionality shared between both. In particular, any method related to 66 // functionality shared between both. In particular, any method related to
67 // input, layout, or painting probably belongs on LocalFrame. 67 // input, layout, or painting probably belongs on LocalFrame.
68 class CORE_EXPORT Frame : public GarbageCollectedFinalized<Frame> { 68 class CORE_EXPORT Frame : public GarbageCollectedFinalized<Frame> {
69 public: 69 public:
70 virtual ~Frame(); 70 virtual ~Frame();
71 71
72 DECLARE_VIRTUAL_TRACE(); 72 DECLARE_VIRTUAL_TRACE();
73 73
74 virtual bool isLocalFrame() const = 0; 74 virtual bool isLocalFrame() const = 0;
75 virtual bool isRemoteFrame() const = 0; 75 virtual bool isRemoteFrame() const = 0;
76 76
77 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0;
78
79 virtual void navigate(Document& originDocument, 77 virtual void navigate(Document& originDocument,
80 const KURL&, 78 const KURL&,
81 bool replaceCurrentItem, 79 bool replaceCurrentItem,
82 UserGestureStatus) = 0; 80 UserGestureStatus) = 0;
83 // This version of Frame::navigate assumes the resulting navigation is not 81 // This version of Frame::navigate assumes the resulting navigation is not
84 // to be started on a timer. Use the method above in such cases. 82 // to be started on a timer. Use the method above in such cases.
85 virtual void navigate(const FrameLoadRequest&) = 0; 83 virtual void navigate(const FrameLoadRequest&) = 0;
86 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0; 84 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0;
87 85
88 virtual void detach(FrameDetachType); 86 virtual void detach(FrameDetachType);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 132
135 Settings* settings() const; // can be null 133 Settings* settings() const; // can be null
136 134
137 // isLoading() is true when the embedder should think a load is in progress. 135 // isLoading() is true when the embedder should think a load is in progress.
138 // In the case of LocalFrames, it means that the frame has sent a 136 // In the case of LocalFrames, it means that the frame has sent a
139 // didStartLoading() callback, but not the matching didStopLoading(). Inside 137 // didStartLoading() callback, but not the matching didStopLoading(). Inside
140 // blink, you probably want Document::loadEventFinished() instead. 138 // blink, you probably want Document::loadEventFinished() instead.
141 void setIsLoading(bool isLoading) { m_isLoading = isLoading; } 139 void setIsLoading(bool isLoading) { m_isLoading = isLoading; }
142 bool isLoading() const { return m_isLoading; } 140 bool isLoading() const { return m_isLoading; }
143 141
144 virtual WindowProxyManagerBase* getWindowProxyManager() const = 0; 142 WindowProxyManager* getWindowProxyManager() const {
143 return m_windowProxyManager;
144 }
145 WindowProxy* windowProxy(DOMWrapperWorld&);
145 146
146 virtual void didChangeVisibilityState(); 147 virtual void didChangeVisibilityState();
147 148
148 void setDocumentHasReceivedUserGesture(); 149 void setDocumentHasReceivedUserGesture();
149 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; } 150 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; }
150 151
151 bool isDetaching() const { return m_isDetaching; } 152 bool isDetaching() const { return m_isDetaching; }
152 153
153 // Tests whether the feature-policy controlled feature is enabled by policy in 154 // Tests whether the feature-policy controlled feature is enabled by policy in
154 // the given frame. 155 // the given frame.
155 bool isFeatureEnabled(WebFeaturePolicyFeature) const; 156 bool isFeatureEnabled(WebFeaturePolicyFeature) const;
156 157
157 protected: 158 protected:
158 Frame(FrameClient*, FrameHost*, FrameOwner*); 159 Frame(FrameClient*, FrameHost*, FrameOwner*, WindowProxyManager*);
159 160
160 mutable FrameTree m_treeNode; 161 mutable FrameTree m_treeNode;
161 162
162 Member<FrameHost> m_host; 163 Member<FrameHost> m_host;
163 Member<FrameOwner> m_owner; 164 Member<FrameOwner> m_owner;
164 Member<DOMWindow> m_domWindow; 165 Member<DOMWindow> m_domWindow;
165 166
166 bool m_hasReceivedUserGesture = false; 167 bool m_hasReceivedUserGesture = false;
167 bool m_isDetaching = false; 168 bool m_isDetaching = false;
168 169
169 private: 170 private:
170 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason); 171 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason);
171 172
172 Member<FrameClient> m_client; 173 Member<FrameClient> m_client;
174 const Member<WindowProxyManager> m_windowProxyManager;
173 bool m_isLoading; 175 bool m_isLoading;
174 }; 176 };
175 177
176 inline FrameClient* Frame::client() const { 178 inline FrameClient* Frame::client() const {
177 return m_client; 179 return m_client;
178 } 180 }
179 181
180 inline FrameOwner* Frame::owner() const { 182 inline FrameOwner* Frame::owner() const {
181 return m_owner; 183 return m_owner;
182 } 184 }
183 185
184 inline FrameTree& Frame::tree() const { 186 inline FrameTree& Frame::tree() const {
185 return m_treeNode; 187 return m_treeNode;
186 } 188 }
187 189
188 // Allow equality comparisons of Frames by reference or pointer, 190 // Allow equality comparisons of Frames by reference or pointer,
189 // interchangeably. 191 // interchangeably.
190 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame) 192 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame)
191 193
192 } // namespace blink 194 } // namespace blink
193 195
194 #endif // Frame_h 196 #endif // Frame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698