OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 class SmartClipData { | 40 class SmartClipData { |
41 public: | 41 public: |
42 SmartClipData() | 42 SmartClipData() |
43 : m_isEmpty(true) | 43 : m_isEmpty(true) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 SmartClipData(Node* node, IntRect rect, String string) | 47 SmartClipData(Node* node, IntRect rect, String string) |
48 : m_isEmpty(!node) | 48 : m_isEmpty(!node) |
49 , m_rect(rect) | 49 , m_rectInViewport(rect) |
50 , m_string(string) | 50 , m_string(string) |
51 { | 51 { |
52 } | 52 } |
53 | 53 |
54 IntRect rect() const; | 54 IntRect rectInViewport() const; |
55 const String& clipData() const; | 55 const String& clipData() const; |
56 | 56 |
57 private: | 57 private: |
58 bool m_isEmpty; | 58 bool m_isEmpty; |
59 IntRect m_rect; | 59 IntRect m_rectInViewport; |
60 String m_string; | 60 String m_string; |
61 }; | 61 }; |
62 | 62 |
63 // SmartClip implements support for the copy operation | 63 // SmartClip implements support for the copy operation |
64 // with an S-Pen on Samsung devices. The behavior of this | 64 // with an S-Pen on Samsung devices. The behavior of this |
65 // class is quirky and poorly tested. It's approximately | 65 // class is quirky and poorly tested. It's approximately |
66 // trying to do a poor-mans implementation of columnar | 66 // trying to do a poor-mans implementation of columnar |
67 // selection followed by a copy operation. | 67 // selection followed by a copy operation. |
68 class SmartClip { | 68 class SmartClip { |
69 STACK_ALLOCATED(); | 69 STACK_ALLOCATED(); |
70 public: | 70 public: |
71 explicit SmartClip(PassRefPtrWillBeRawPtr<LocalFrame>); | 71 explicit SmartClip(PassRefPtrWillBeRawPtr<LocalFrame>); |
72 | 72 |
73 SmartClipData dataForRect(const IntRect&); | 73 SmartClipData dataForRect(const IntRect&); |
74 | 74 |
75 private: | 75 private: |
76 float pageScaleFactor(); | 76 float pageScaleFactor(); |
77 | 77 |
78 Node* minNodeContainsNodes(Node* minNode, Node* newNode); | 78 Node* minNodeContainsNodes(Node* minNode, Node* newNode); |
79 Node* findBestOverlappingNode(Node*, const IntRect& cropRect); | 79 Node* findBestOverlappingNode(Node*, const IntRect& cropRectInViewport); |
80 bool shouldSkipBackgroundImage(Node*); | 80 bool shouldSkipBackgroundImage(Node*); |
81 void collectOverlappingChildNodes(Node* parentNode, const IntRect& cropRect,
WillBeHeapVector<RawPtrWillBeMember<Node>>& overlappingNodeInfoTable); | 81 void collectOverlappingChildNodes(Node* parentNode, const IntRect& cropRectI
nViewport, WillBeHeapVector<RawPtrWillBeMember<Node>>& overlappingNodeInfoTable)
; |
82 IntRect convertRectToWindow(const IntRect& nodeRect); | |
83 String extractTextFromNode(Node*); | 82 String extractTextFromNode(Node*); |
84 | 83 |
85 RefPtrWillBeMember<LocalFrame> m_frame; | 84 RefPtrWillBeMember<LocalFrame> m_frame; |
86 }; | 85 }; |
87 | 86 |
88 } // namespace blink | 87 } // namespace blink |
89 | 88 |
90 #endif // SmartClip_h | 89 #endif // SmartClip_h |
OLD | NEW |