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