OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebLocalFrame_h | 5 #ifndef WebLocalFrame_h |
6 #define WebLocalFrame_h | 6 #define WebLocalFrame_h |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include "WebCompositionUnderline.h" | 9 #include "WebCompositionUnderline.h" |
10 #include "WebFrame.h" | 10 #include "WebFrame.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 class WebSharedWorkerRepositoryClient; | 41 class WebSharedWorkerRepositoryClient; |
42 class WebTextCheckClient; | 42 class WebTextCheckClient; |
43 class WebURLLoader; | 43 class WebURLLoader; |
44 enum class WebCachePolicy; | 44 enum class WebCachePolicy; |
45 enum class WebSandboxFlags; | 45 enum class WebSandboxFlags; |
46 enum class WebTreeScopeType; | 46 enum class WebTreeScopeType; |
47 struct WebConsoleMessage; | 47 struct WebConsoleMessage; |
48 struct WebContentSecurityPolicyViolation; | 48 struct WebContentSecurityPolicyViolation; |
49 struct WebFindOptions; | 49 struct WebFindOptions; |
50 struct WebFloatRect; | 50 struct WebFloatRect; |
| 51 struct WebPrintParams; |
51 struct WebPrintPresetOptions; | 52 struct WebPrintPresetOptions; |
52 struct WebSourceLocation; | 53 struct WebSourceLocation; |
53 | 54 |
54 // Interface for interacting with in process frames. This contains methods that | 55 // Interface for interacting with in process frames. This contains methods that |
55 // require interacting with a frame's document. | 56 // require interacting with a frame's document. |
56 // FIXME: Move lots of methods from WebFrame in here. | 57 // FIXME: Move lots of methods from WebFrame in here. |
57 class WebLocalFrame : public WebFrame { | 58 class WebLocalFrame : public WebFrame { |
58 public: | 59 public: |
59 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). | 60 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). |
60 // WebFrameClient may not be null. | 61 // WebFrameClient may not be null. |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 613 |
613 // Creates and returns a loader. This function can be called only when this | 614 // Creates and returns a loader. This function can be called only when this |
614 // frame is attached to a document. | 615 // frame is attached to a document. |
615 virtual std::unique_ptr<WebURLLoader> CreateURLLoader() = 0; | 616 virtual std::unique_ptr<WebURLLoader> CreateURLLoader() = 0; |
616 | 617 |
617 // Geometry ----------------------------------------------------------------- | 618 // Geometry ----------------------------------------------------------------- |
618 | 619 |
619 // If set to false, do not draw scrollbars on this frame's view. | 620 // If set to false, do not draw scrollbars on this frame's view. |
620 virtual void SetCanHaveScrollbars(bool) = 0; | 621 virtual void SetCanHaveScrollbars(bool) = 0; |
621 | 622 |
| 623 // Printing ------------------------------------------------------------ |
| 624 |
| 625 // Reformats the WebFrame for printing. WebPrintParams specifies the printable |
| 626 // content size, paper size, printable area size, printer DPI and print |
| 627 // scaling option. If constrainToNode node is specified, then only the given |
| 628 // node is printed (for now only plugins are supported), instead of the entire |
| 629 // frame. |
| 630 // Returns the number of pages that can be printed at the given |
| 631 // page size. |
| 632 virtual int PrintBegin(const WebPrintParams&, |
| 633 const WebNode& constrain_to_node = WebNode()) = 0; |
| 634 |
| 635 // Returns the page shrinking factor calculated by webkit (usually |
| 636 // between 1/1.33 and 1/2). Returns 0 if the page number is invalid or |
| 637 // not in printing mode. |
| 638 virtual float GetPrintPageShrink(int page) = 0; |
| 639 |
| 640 // Prints one page, and returns the calculated page shrinking factor |
| 641 // (usually between 1/1.33 and 1/2). Returns 0 if the page number is |
| 642 // invalid or not in printing mode. |
| 643 virtual float PrintPage(int page_to_print, WebCanvas*) = 0; |
| 644 |
| 645 // Reformats the WebFrame for screen display. |
| 646 virtual void PrintEnd() = 0; |
| 647 |
| 648 // If the frame contains a full-frame plugin or the given node refers to a |
| 649 // plugin whose content indicates that printed output should not be scaled, |
| 650 // return true, otherwise return false. |
| 651 virtual bool IsPrintScalingDisabledForPlugin(const WebNode& = WebNode()) = 0; |
| 652 |
622 // Testing ------------------------------------------------------------------ | 653 // Testing ------------------------------------------------------------------ |
623 | 654 |
624 // Dumps the layer tree, used by the accelerated compositor, in | 655 // Dumps the layer tree, used by the accelerated compositor, in |
625 // text form. This is used only by layout tests. | 656 // text form. This is used only by layout tests. |
626 virtual WebString GetLayerTreeAsTextForTesting( | 657 virtual WebString GetLayerTreeAsTextForTesting( |
627 bool show_debug_info = false) const = 0; | 658 bool show_debug_info = false) const = 0; |
628 | 659 |
| 660 // Prints the frame into the canvas, with page boundaries drawn as one pixel |
| 661 // wide blue lines. This method exists to support layout tests. |
| 662 virtual void PrintPagesForTesting(WebCanvas*, const WebSize&) = 0; |
| 663 |
| 664 // Returns the bounds rect for current selection. If selection is performed |
| 665 // on transformed text, the rect will still bound the selection but will |
| 666 // not be transformed itself. If no selection is present, the rect will be |
| 667 // empty ((0,0), (0,0)). |
| 668 virtual WebRect GetSelectionBoundsRectForTesting() const = 0; |
| 669 |
629 protected: | 670 protected: |
630 explicit WebLocalFrame(WebTreeScopeType scope) : WebFrame(scope) {} | 671 explicit WebLocalFrame(WebTreeScopeType scope) : WebFrame(scope) {} |
631 | 672 |
632 // Inherited from WebFrame, but intentionally hidden: it never makes sense | 673 // Inherited from WebFrame, but intentionally hidden: it never makes sense |
633 // to call these on a WebLocalFrame. | 674 // to call these on a WebLocalFrame. |
634 bool IsWebLocalFrame() const override = 0; | 675 bool IsWebLocalFrame() const override = 0; |
635 WebLocalFrame* ToWebLocalFrame() override = 0; | 676 WebLocalFrame* ToWebLocalFrame() override = 0; |
636 bool IsWebRemoteFrame() const override = 0; | 677 bool IsWebRemoteFrame() const override = 0; |
637 WebRemoteFrame* ToWebRemoteFrame() override = 0; | 678 WebRemoteFrame* ToWebRemoteFrame() override = 0; |
638 }; | 679 }; |
639 | 680 |
640 } // namespace blink | 681 } // namespace blink |
641 | 682 |
642 #endif // WebLocalFrame_h | 683 #endif // WebLocalFrame_h |
OLD | NEW |