OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 20 matching lines...) Expand all Loading... |
31 #ifndef WebLocalFrameImpl_h | 31 #ifndef WebLocalFrameImpl_h |
32 #define WebLocalFrameImpl_h | 32 #define WebLocalFrameImpl_h |
33 | 33 |
34 #include "core/editing/VisiblePosition.h" | 34 #include "core/editing/VisiblePosition.h" |
35 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
36 #include "platform/geometry/FloatRect.h" | 36 #include "platform/geometry/FloatRect.h" |
37 #include "public/platform/WebFileSystemType.h" | 37 #include "public/platform/WebFileSystemType.h" |
38 #include "public/web/WebLocalFrame.h" | 38 #include "public/web/WebLocalFrame.h" |
39 #include "web/FrameLoaderClientImpl.h" | 39 #include "web/FrameLoaderClientImpl.h" |
40 #include "web/UserMediaClientImpl.h" | 40 #include "web/UserMediaClientImpl.h" |
| 41 #include "web/WebFrameImplBase.h" |
41 #include "wtf/Compiler.h" | 42 #include "wtf/Compiler.h" |
42 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
43 #include "wtf/RefCounted.h" | 44 #include "wtf/RefCounted.h" |
44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 class ChromePrintContext; | 49 class ChromePrintContext; |
49 class GeolocationClientProxy; | 50 class GeolocationClientProxy; |
50 class IntSize; | 51 class IntSize; |
(...skipping 14 matching lines...) Expand all Loading... |
65 class WebScriptExecutionCallback; | 66 class WebScriptExecutionCallback; |
66 class WebSuspendableTask; | 67 class WebSuspendableTask; |
67 class WebView; | 68 class WebView; |
68 class WebViewImpl; | 69 class WebViewImpl; |
69 struct FrameLoadRequest; | 70 struct FrameLoadRequest; |
70 struct WebPrintParams; | 71 struct WebPrintParams; |
71 | 72 |
72 template <typename T> class WebVector; | 73 template <typename T> class WebVector; |
73 | 74 |
74 // Implementation of WebFrame, note that this is a reference counted object. | 75 // Implementation of WebFrame, note that this is a reference counted object. |
75 class WebLocalFrameImpl final : public RefCountedWillBeGarbageCollectedFinalized
<WebLocalFrameImpl>, public WebLocalFrame { | 76 class WebLocalFrameImpl final : public WebFrameImplBase, public WebLocalFrame { |
76 public: | 77 public: |
77 // WebFrame methods: | 78 // WebFrame methods: |
78 bool isWebLocalFrame() const override; | 79 bool isWebLocalFrame() const override; |
79 WebLocalFrame* toWebLocalFrame() override; | 80 WebLocalFrame* toWebLocalFrame() override; |
80 bool isWebRemoteFrame() const override; | 81 bool isWebRemoteFrame() const override; |
81 WebRemoteFrame* toWebRemoteFrame() override; | 82 WebRemoteFrame* toWebRemoteFrame() override; |
82 void close() override; | 83 void close() override; |
83 WebString uniqueName() const override; | 84 WebString uniqueName() const override; |
84 WebString assignedName() const override; | 85 WebString assignedName() const override; |
85 void setName(const WebString&) override; | 86 void setName(const WebString&) override; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 WebString layoutTreeAsText(LayoutAsTextControls toShow = LayoutAsTextNormal)
const override; | 221 WebString layoutTreeAsText(LayoutAsTextControls toShow = LayoutAsTextNormal)
const override; |
221 | 222 |
222 WebString markerTextForListItem(const WebElement&) const override; | 223 WebString markerTextForListItem(const WebElement&) const override; |
223 WebRect selectionBoundsRect() const override; | 224 WebRect selectionBoundsRect() const override; |
224 | 225 |
225 bool selectionStartHasSpellingMarkerFor(int from, int length) const override
; | 226 bool selectionStartHasSpellingMarkerFor(int from, int length) const override
; |
226 WebString layerTreeAsText(bool showDebugInfo = false) const override; | 227 WebString layerTreeAsText(bool showDebugInfo = false) const override; |
227 | 228 |
228 void registerTestInterface(const WebString& name, WebTestInterfaceFactory*)
override; | 229 void registerTestInterface(const WebString& name, WebTestInterfaceFactory*)
override; |
229 | 230 |
| 231 WebFrameImplBase* toImplBase() override { return this; } |
| 232 |
230 // Creates a test interface by name if available, returns an empty handle | 233 // Creates a test interface by name if available, returns an empty handle |
231 // for unknown names. | 234 // for unknown names. |
232 v8::Local<v8::Value> createTestInterface(const AtomicString& name); | 235 v8::Local<v8::Value> createTestInterface(const AtomicString& name); |
233 | 236 |
234 // WebLocalFrame methods: | 237 // WebLocalFrame methods: |
235 void initializeToReplaceRemoteFrame(WebRemoteFrame*, const WebString& name,
WebSandboxFlags, const WebFrameOwnerProperties&) override; | 238 void initializeToReplaceRemoteFrame(WebRemoteFrame*, const WebString& name,
WebSandboxFlags, const WebFrameOwnerProperties&) override; |
236 void setAutofillClient(WebAutofillClient*) override; | 239 void setAutofillClient(WebAutofillClient*) override; |
237 WebAutofillClient* autofillClient() override; | 240 WebAutofillClient* autofillClient() override; |
238 void setDevToolsAgentClient(WebDevToolsAgentClient*) override; | 241 void setDevToolsAgentClient(WebDevToolsAgentClient*) override; |
239 WebDevToolsAgent* devToolsAgent() override; | 242 WebDevToolsAgent* devToolsAgent() override; |
240 void setFrameOwnerProperties(const WebFrameOwnerProperties&) override; | 243 void setFrameOwnerProperties(const WebFrameOwnerProperties&) override; |
241 void sendPings(const WebNode& contextNode, const WebURL& destinationURL) ove
rride; | 244 void sendPings(const WebNode& contextNode, const WebURL& destinationURL) ove
rride; |
242 WebURLRequest requestFromHistoryItem(const WebHistoryItem&, WebURLRequest::C
achePolicy) | 245 WebURLRequest requestFromHistoryItem(const WebHistoryItem&, WebURLRequest::C
achePolicy) |
243 const override; | 246 const override; |
244 WebURLRequest requestForReload(WebFrameLoadType, const WebURL&) const overri
de; | 247 WebURLRequest requestForReload(WebFrameLoadType, const WebURL&) const overri
de; |
245 void load(const WebURLRequest&, WebFrameLoadType, const WebHistoryItem&, | 248 void load(const WebURLRequest&, WebFrameLoadType, const WebHistoryItem&, |
246 WebHistoryLoadType) override; | 249 WebHistoryLoadType) override; |
247 bool isLoading() const override; | 250 bool isLoading() const override; |
248 bool isResourceLoadInProgress() const override; | 251 bool isResourceLoadInProgress() const override; |
249 bool isNavigationScheduled() const override; | 252 bool isNavigationScheduled() const override; |
250 void setCommittedFirstRealLoad() override; | 253 void setCommittedFirstRealLoad() override; |
251 void sendOrientationChangeEvent() override; | 254 void sendOrientationChangeEvent() override; |
252 void willShowInstallBannerPrompt(int requestId, const WebVector<WebString>&
platforms, WebAppBannerPromptReply*) override; | 255 void willShowInstallBannerPrompt(int requestId, const WebVector<WebString>&
platforms, WebAppBannerPromptReply*) override; |
253 WebSandboxFlags effectiveSandboxFlags() const override; | 256 WebSandboxFlags effectiveSandboxFlags() const override; |
254 void requestRunTask(WebSuspendableTask*) const override; | 257 void requestRunTask(WebSuspendableTask*) const override; |
255 void didCallAddSearchProvider() override; | 258 void didCallAddSearchProvider() override; |
256 void didCallIsSearchProviderInstalled() override; | 259 void didCallIsSearchProviderInstalled() override; |
257 void replaceSelection(const WebString&) override; | 260 void replaceSelection(const WebString&) override; |
258 | 261 |
| 262 // WebFrameImplBase methods: |
| 263 void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name,
const AtomicString& fallbackName) override; |
| 264 LocalFrame* frame() const override { return m_frame.get(); } |
| 265 |
259 void willBeDetached(); | 266 void willBeDetached(); |
260 void willDetachParent(); | 267 void willDetachParent(); |
261 | 268 |
262 static WebLocalFrameImpl* create(WebTreeScopeType, WebFrameClient*); | 269 static WebLocalFrameImpl* create(WebTreeScopeType, WebFrameClient*); |
263 ~WebLocalFrameImpl() override; | 270 ~WebLocalFrameImpl() override; |
264 | 271 |
265 PassRefPtrWillBeRawPtr<LocalFrame> initializeCoreFrame(FrameHost*, FrameOwne
r*, const AtomicString& name, const AtomicString& fallbackName); | |
266 | |
267 PassRefPtrWillBeRawPtr<LocalFrame> createChildFrame(const FrameLoadRequest&,
const AtomicString& name, HTMLFrameOwnerElement*); | 272 PassRefPtrWillBeRawPtr<LocalFrame> createChildFrame(const FrameLoadRequest&,
const AtomicString& name, HTMLFrameOwnerElement*); |
268 | 273 |
269 void didChangeContentsSize(const IntSize&); | 274 void didChangeContentsSize(const IntSize&); |
270 | 275 |
271 void createFrameView(); | 276 void createFrameView(); |
272 | 277 |
273 static WebLocalFrameImpl* fromFrame(LocalFrame*); | 278 static WebLocalFrameImpl* fromFrame(LocalFrame*); |
274 static WebLocalFrameImpl* fromFrame(LocalFrame&); | 279 static WebLocalFrameImpl* fromFrame(LocalFrame&); |
275 static WebLocalFrameImpl* fromFrameOwnerElement(Element*); | 280 static WebLocalFrameImpl* fromFrameOwnerElement(Element*); |
276 | 281 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // allows us to navigate by pressing Enter after closing the Find box. | 316 // allows us to navigate by pressing Enter after closing the Find box. |
312 void setFindEndstateFocusAndSelection(); | 317 void setFindEndstateFocusAndSelection(); |
313 | 318 |
314 void didFail(const ResourceError&, bool wasProvisional, HistoryCommitType); | 319 void didFail(const ResourceError&, bool wasProvisional, HistoryCommitType); |
315 | 320 |
316 // Sets whether the WebLocalFrameImpl allows its document to be scrolled. | 321 // Sets whether the WebLocalFrameImpl allows its document to be scrolled. |
317 // If the parameter is true, allow the document to be scrolled. | 322 // If the parameter is true, allow the document to be scrolled. |
318 // Otherwise, disallow scrolling. | 323 // Otherwise, disallow scrolling. |
319 void setCanHaveScrollbars(bool) override; | 324 void setCanHaveScrollbars(bool) override; |
320 | 325 |
321 LocalFrame* frame() const { return m_frame.get(); } | |
322 WebFrameClient* client() const { return m_client; } | 326 WebFrameClient* client() const { return m_client; } |
323 void setClient(WebFrameClient* client) { m_client = client; } | 327 void setClient(WebFrameClient* client) { m_client = client; } |
324 | 328 |
325 WebContentSettingsClient* contentSettingsClient() { return m_contentSettings
Client; } | 329 WebContentSettingsClient* contentSettingsClient() { return m_contentSettings
Client; } |
326 SharedWorkerRepositoryClientImpl* sharedWorkerRepositoryClient() const { ret
urn m_sharedWorkerRepositoryClient.get(); } | 330 SharedWorkerRepositoryClientImpl* sharedWorkerRepositoryClient() const { ret
urn m_sharedWorkerRepositoryClient.get(); } |
327 | 331 |
328 void setInputEventsTransformForEmulation(const IntSize&, float); | 332 void setInputEventsTransformForEmulation(const IntSize&, float); |
329 | 333 |
330 static void selectWordAroundPosition(LocalFrame*, VisiblePosition); | 334 static void selectWordAroundPosition(LocalFrame*, VisiblePosition); |
331 | 335 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // cleared upon close(). | 406 // cleared upon close(). |
403 SelfKeepAlive<WebLocalFrameImpl> m_selfKeepAlive; | 407 SelfKeepAlive<WebLocalFrameImpl> m_selfKeepAlive; |
404 #endif | 408 #endif |
405 }; | 409 }; |
406 | 410 |
407 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); | 411 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); |
408 | 412 |
409 } // namespace blink | 413 } // namespace blink |
410 | 414 |
411 #endif | 415 #endif |
OLD | NEW |