OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 29 matching lines...) Expand all Loading... |
40 { | 40 { |
41 const Node* node = webNode.constUnwrap<Node>(); | 41 const Node* node = webNode.constUnwrap<Node>(); |
42 if (!node || !node->layoutObject()) | 42 if (!node || !node->layoutObject()) |
43 return; | 43 return; |
44 | 44 |
45 m_private.reset(new SurroundingText(createVisiblePosition(node->layoutObject
()->positionForPoint(static_cast<IntPoint>(nodePoint))).deepEquivalent().parentA
nchoredEquivalent(), maxLength)); | 45 m_private.reset(new SurroundingText(createVisiblePosition(node->layoutObject
()->positionForPoint(static_cast<IntPoint>(nodePoint))).deepEquivalent().parentA
nchoredEquivalent(), maxLength)); |
46 } | 46 } |
47 | 47 |
48 void WebSurroundingText::initialize(const WebRange& webRange, size_t maxLength) | 48 void WebSurroundingText::initialize(const WebRange& webRange, size_t maxLength) |
49 { | 49 { |
50 if (RawPtr<Range> range = static_cast<RawPtr<Range>>(webRange)) | 50 if (Range* range = static_cast<Range*>(webRange)) |
51 m_private.reset(new SurroundingText(*range, maxLength)); | 51 m_private.reset(new SurroundingText(*range, maxLength)); |
52 } | 52 } |
53 | 53 |
54 WebString WebSurroundingText::textContent() const | 54 WebString WebSurroundingText::textContent() const |
55 { | 55 { |
56 return m_private->content(); | 56 return m_private->content(); |
57 } | 57 } |
58 | 58 |
59 size_t WebSurroundingText::hitOffsetInTextContent() const | 59 size_t WebSurroundingText::hitOffsetInTextContent() const |
60 { | 60 { |
(...skipping 20 matching lines...) Expand all Loading... |
81 { | 81 { |
82 return !m_private.get(); | 82 return !m_private.get(); |
83 } | 83 } |
84 | 84 |
85 void WebSurroundingText::reset() | 85 void WebSurroundingText::reset() |
86 { | 86 { |
87 m_private.reset(0); | 87 m_private.reset(0); |
88 } | 88 } |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
OLD | NEW |