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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 template <typename T> class WebVector; | 92 template <typename T> class WebVector; |
93 | 93 |
94 // Frames may be rendered in process ('local') or out of process ('remote'). | 94 // Frames may be rendered in process ('local') or out of process ('remote'). |
95 // A remote frame is always cross-site; a local frame may be either same-site or | 95 // A remote frame is always cross-site; a local frame may be either same-site or |
96 // cross-site. | 96 // cross-site. |
97 // WebFrame is the base class for both WebLocalFrame and WebRemoteFrame and | 97 // WebFrame is the base class for both WebLocalFrame and WebRemoteFrame and |
98 // contains methods that are valid on both local and remote frames, such as | 98 // contains methods that are valid on both local and remote frames, such as |
99 // getting a frame's parent or its opener. | 99 // getting a frame's parent or its opener. |
100 class WebFrame { | 100 class WebFrame { |
101 public: | 101 public: |
102 // Control of layoutTreeAsText output | |
103 enum LayoutAsTextControl { | |
104 LayoutAsTextNormal = 0, | |
105 LayoutAsTextDebug = 1 << 0, | |
106 LayoutAsTextPrinting = 1 << 1, | |
107 LayoutAsTextWithLineTrees = 1 << 2 | |
108 }; | |
109 typedef unsigned LayoutAsTextControls; | |
110 | 102 |
111 // FIXME: We already have blink::TextGranularity. For now we support only | 103 // FIXME: We already have blink::TextGranularity. For now we support only |
112 // a part of blink::TextGranularity. | 104 // a part of blink::TextGranularity. |
113 // Ideally it seems blink::TextGranularity should be broken up into | 105 // Ideally it seems blink::TextGranularity should be broken up into |
114 // blink::TextGranularity and perhaps blink::TextBoundary and then | 106 // blink::TextGranularity and perhaps blink::TextBoundary and then |
115 // TextGranularity enum could be moved somewhere to public/, and we could | 107 // TextGranularity enum could be moved somewhere to public/, and we could |
116 // just use it here directly without introducing a new enum. | 108 // just use it here directly without introducing a new enum. |
117 enum TextGranularity { | 109 enum TextGranularity { |
118 CharacterGranularity = 0, | 110 CharacterGranularity = 0, |
119 WordGranularity, | 111 WordGranularity, |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // Events -------------------------------------------------------------- | 540 // Events -------------------------------------------------------------- |
549 | 541 |
550 // Dispatches a message event on the current DOMWindow in this WebFrame. | 542 // Dispatches a message event on the current DOMWindow in this WebFrame. |
551 virtual void dispatchMessageEventWithOriginCheck( | 543 virtual void dispatchMessageEventWithOriginCheck( |
552 const WebSecurityOrigin& intendedTargetOrigin, | 544 const WebSecurityOrigin& intendedTargetOrigin, |
553 const WebDOMEvent&) = 0; | 545 const WebDOMEvent&) = 0; |
554 | 546 |
555 | 547 |
556 // Utility ------------------------------------------------------------- | 548 // Utility ------------------------------------------------------------- |
557 | 549 |
558 // Returns the contents of this frame as a string. If the text is | |
559 // longer than maxChars, it will be clipped to that length. WARNING: | |
560 // This function may be slow depending on the number of characters | |
561 // retrieved and page complexity. For a typically sized page, expect | |
562 // it to take on the order of milliseconds. | |
563 // | |
564 // If there is room, subframe text will be recursively appended. Each | |
565 // frame will be separated by an empty line. | |
566 virtual WebString contentAsText(size_t maxChars) const = 0; | |
567 | |
568 // Returns HTML text for the contents of this frame. This is generated | |
569 // from the DOM. | |
570 virtual WebString contentAsMarkup() const = 0; | |
571 | |
572 // Returns a text representation of the render tree. This method is used | |
573 // to support layout tests. | |
574 virtual WebString layoutTreeAsText(LayoutAsTextControls toShow = LayoutAsTex
tNormal) const = 0; | |
575 | |
576 // Calls markerTextForListItem() defined in core/layout/LayoutTreeAsText.h. | |
577 virtual WebString markerTextForListItem(const WebElement&) const = 0; | |
578 | |
579 // Prints all of the pages into the canvas, with page boundaries drawn as | 550 // Prints all of the pages into the canvas, with page boundaries drawn as |
580 // one pixel wide blue lines. This method exists to support layout tests. | 551 // one pixel wide blue lines. This method exists to support layout tests. |
581 virtual void printPagesWithBoundaries(WebCanvas*, const WebSize&) = 0; | 552 virtual void printPagesWithBoundaries(WebCanvas*, const WebSize&) = 0; |
582 | 553 |
583 // Returns the bounds rect for current selection. If selection is performed | 554 // Returns the bounds rect for current selection. If selection is performed |
584 // on transformed text, the rect will still bound the selection but will | 555 // on transformed text, the rect will still bound the selection but will |
585 // not be transformed itself. If no selection is present, the rect will be | 556 // not be transformed itself. If no selection is present, the rect will be |
586 // empty ((0,0), (0,0)). | 557 // empty ((0,0), (0,0)). |
587 virtual WebRect selectionBoundsRect() const = 0; | 558 virtual WebRect selectionBoundsRect() const = 0; |
588 | 559 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 WebFrame* m_firstChild; | 625 WebFrame* m_firstChild; |
655 WebFrame* m_lastChild; | 626 WebFrame* m_lastChild; |
656 | 627 |
657 WebFrame* m_opener; | 628 WebFrame* m_opener; |
658 WebPrivateOwnPtr<OpenedFrameTracker> m_openedFrameTracker; | 629 WebPrivateOwnPtr<OpenedFrameTracker> m_openedFrameTracker; |
659 }; | 630 }; |
660 | 631 |
661 } // namespace blink | 632 } // namespace blink |
662 | 633 |
663 #endif | 634 #endif |
OLD | NEW |