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