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