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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 template <typename T> class WebVector; | 70 template <typename T> class WebVector; |
71 | 71 |
72 // Implementation of WebFrame, note that this is a reference counted object. | 72 // Implementation of WebFrame, note that this is a reference counted object. |
73 class WebFrameImpl | 73 class WebFrameImpl |
74 : public WebFrame | 74 : public WebFrame |
75 , public RefCounted<WebFrameImpl> | 75 , public RefCounted<WebFrameImpl> |
76 , public WebCore::FrameDestructionObserver { | 76 , public WebCore::FrameDestructionObserver { |
77 public: | 77 public: |
78 // WebFrame methods: | 78 // WebFrame methods: |
| 79 virtual void close(); |
79 virtual WebString uniqueName() const; | 80 virtual WebString uniqueName() const; |
80 virtual WebString assignedName() const; | 81 virtual WebString assignedName() const; |
81 virtual void setName(const WebString&); | 82 virtual void setName(const WebString&); |
82 virtual long long identifier() const; | 83 virtual long long embedderIdentifier() const; |
83 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const; | 84 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const; |
84 virtual WebSize scrollOffset() const; | 85 virtual WebSize scrollOffset() const; |
85 virtual void setScrollOffset(const WebSize&); | 86 virtual void setScrollOffset(const WebSize&); |
86 virtual WebSize minimumScrollOffset() const; | 87 virtual WebSize minimumScrollOffset() const; |
87 virtual WebSize maximumScrollOffset() const; | 88 virtual WebSize maximumScrollOffset() const; |
88 virtual WebSize contentsSize() const; | 89 virtual WebSize contentsSize() const; |
89 virtual bool hasVisibleContent() const; | 90 virtual bool hasVisibleContent() const; |
90 virtual WebRect visibleContentRect() const; | 91 virtual WebRect visibleContentRect() const; |
91 virtual bool hasHorizontalScrollbar() const; | 92 virtual bool hasHorizontalScrollbar() const; |
92 virtual bool hasVerticalScrollbar() const; | 93 virtual bool hasVerticalScrollbar() const; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 virtual WebString renderTreeAsText(RenderAsTextControls toShow = RenderAsTex
tNormal) const; | 233 virtual WebString renderTreeAsText(RenderAsTextControls toShow = RenderAsTex
tNormal) const; |
233 virtual WebString markerTextForListItem(const WebElement&) const; | 234 virtual WebString markerTextForListItem(const WebElement&) const; |
234 virtual WebRect selectionBoundsRect() const; | 235 virtual WebRect selectionBoundsRect() const; |
235 | 236 |
236 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const; | 237 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const; |
237 virtual WebString layerTreeAsText(bool showDebugInfo = false) const; | 238 virtual WebString layerTreeAsText(bool showDebugInfo = false) const; |
238 | 239 |
239 // WebCore::FrameDestructionObserver methods. | 240 // WebCore::FrameDestructionObserver methods. |
240 virtual void willDetachPage(); | 241 virtual void willDetachPage(); |
241 | 242 |
242 static PassRefPtr<WebFrameImpl> create(WebFrameClient* client); | 243 static WebFrameImpl* create(WebFrameClient*); |
| 244 // FIXME: Move the embedderIdentifier concept fully to the embedder and |
| 245 // remove this factory method. |
| 246 static WebFrameImpl* create(WebFrameClient*, long long embedderIdentifier); |
243 virtual ~WebFrameImpl(); | 247 virtual ~WebFrameImpl(); |
244 | 248 |
245 // Called by the WebViewImpl to initialize the main frame for the page. | 249 // Called by the WebViewImpl to initialize the main frame for the page. |
246 void initializeAsMainFrame(WebCore::Page*); | 250 void initializeAsMainFrame(WebCore::Page*); |
247 | 251 |
248 PassRefPtr<WebCore::Frame> createChildFrame( | 252 PassRefPtr<WebCore::Frame> createChildFrame( |
249 const WebCore::FrameLoadRequest&, WebCore::HTMLFrameOwnerElement*); | 253 const WebCore::FrameLoadRequest&, WebCore::HTMLFrameOwnerElement*); |
250 | 254 |
251 void didChangeContentsSize(const WebCore::IntSize&); | 255 void didChangeContentsSize(const WebCore::IntSize&); |
252 | 256 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 }; | 325 }; |
322 | 326 |
323 // A bit mask specifying area of the frame to invalidate. | 327 // A bit mask specifying area of the frame to invalidate. |
324 enum AreaToInvalidate { | 328 enum AreaToInvalidate { |
325 InvalidateNothing, | 329 InvalidateNothing, |
326 InvalidateContentArea, | 330 InvalidateContentArea, |
327 InvalidateScrollbar, // Vertical scrollbar only. | 331 InvalidateScrollbar, // Vertical scrollbar only. |
328 InvalidateAll // Both content area and the scrollbar. | 332 InvalidateAll // Both content area and the scrollbar. |
329 }; | 333 }; |
330 | 334 |
331 explicit WebFrameImpl(WebFrameClient*); | 335 WebFrameImpl(WebFrameClient*, long long frame_identifier); |
332 | 336 |
333 // Sets the local WebCore frame and registers destruction observers. | 337 // Sets the local WebCore frame and registers destruction observers. |
334 void setWebCoreFrame(WebCore::Frame*); | 338 void setWebCoreFrame(WebCore::Frame*); |
335 | 339 |
336 // Notifies the delegate about a new selection rect. | 340 // Notifies the delegate about a new selection rect. |
337 void reportFindInPageSelection( | 341 void reportFindInPageSelection( |
338 const WebRect& selectionRect, int activeMatchOrdinal, int identifier); | 342 const WebRect& selectionRect, int activeMatchOrdinal, int identifier); |
339 | 343 |
340 // Clear the find-in-page matches cache forcing rects to be fully | 344 // Clear the find-in-page matches cache forcing rects to be fully |
341 // calculated again next time updateFindMatchRects is called. | 345 // calculated again next time updateFindMatchRects is called. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 489 |
486 // Contents size when find-in-page match rects were last computed for this | 490 // Contents size when find-in-page match rects were last computed for this |
487 // frame's cache. | 491 // frame's cache. |
488 WebCore::IntSize m_contentsSizeForCurrentFindMatchRects; | 492 WebCore::IntSize m_contentsSizeForCurrentFindMatchRects; |
489 | 493 |
490 // Valid between calls to BeginPrint() and EndPrint(). Containts the print | 494 // Valid between calls to BeginPrint() and EndPrint(). Containts the print |
491 // information. Is used by PrintPage(). | 495 // information. Is used by PrintPage(). |
492 OwnPtr<ChromePrintContext> m_printContext; | 496 OwnPtr<ChromePrintContext> m_printContext; |
493 | 497 |
494 // The identifier of this frame. | 498 // The identifier of this frame. |
495 long long m_identifier; | 499 long long m_embedderIdentifier; |
496 | 500 |
497 // Ensure we don't overwrite valid history data during same document loads | 501 // Ensure we don't overwrite valid history data during same document loads |
498 // from HistoryItems | 502 // from HistoryItems |
499 bool m_inSameDocumentHistoryLoad; | 503 bool m_inSameDocumentHistoryLoad; |
500 }; | 504 }; |
501 | 505 |
502 inline WebFrameImpl* toWebFrameImpl(WebFrame* webFrame) | 506 inline WebFrameImpl* toWebFrameImpl(WebFrame* webFrame) |
503 { | 507 { |
504 return static_cast<WebFrameImpl*>(webFrame); | 508 return static_cast<WebFrameImpl*>(webFrame); |
505 } | 509 } |
506 | 510 |
507 inline const WebFrameImpl* toWebFrameImpl(const WebFrame* webFrame) | 511 inline const WebFrameImpl* toWebFrameImpl(const WebFrame* webFrame) |
508 { | 512 { |
509 return static_cast<const WebFrameImpl*>(webFrame); | 513 return static_cast<const WebFrameImpl*>(webFrame); |
510 } | 514 } |
511 | 515 |
512 // This will catch anyone doing an unnecessary cast. | 516 // This will catch anyone doing an unnecessary cast. |
513 void toWebFrameImpl(const WebFrameImpl*); | 517 void toWebFrameImpl(const WebFrameImpl*); |
514 | 518 |
515 } // namespace WebKit | 519 } // namespace WebKit |
516 | 520 |
517 #endif | 521 #endif |
OLD | NEW |