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 17 matching lines...) Expand all Loading... |
28 #include "core/dom/Element.h" | 28 #include "core/dom/Element.h" |
29 #include "core/dom/Node.h" | 29 #include "core/dom/Node.h" |
30 #include "core/dom/Range.h" | 30 #include "core/dom/Range.h" |
31 #include "core/dom/Text.h" | 31 #include "core/dom/Text.h" |
32 #include "core/editing/SurroundingText.h" | 32 #include "core/editing/SurroundingText.h" |
33 #include "core/editing/VisiblePosition.h" | 33 #include "core/editing/VisiblePosition.h" |
34 #include "core/rendering/RenderObject.h" | 34 #include "core/rendering/RenderObject.h" |
35 #include "public/platform/WebPoint.h" | 35 #include "public/platform/WebPoint.h" |
36 #include "public/web/WebHitTestResult.h" | 36 #include "public/web/WebHitTestResult.h" |
37 | 37 |
38 using namespace blink; | |
39 | |
40 namespace blink { | 38 namespace blink { |
41 | 39 |
42 void WebSurroundingText::initialize(const WebNode& webNode, const WebPoint& node
Point, size_t maxLength) | 40 void WebSurroundingText::initialize(const WebNode& webNode, const WebPoint& node
Point, size_t maxLength) |
43 { | 41 { |
44 const Node* node = webNode.constUnwrap<Node>(); | 42 const Node* node = webNode.constUnwrap<Node>(); |
45 if (!node || !node->renderer()) | 43 if (!node || !node->renderer()) |
46 return; | 44 return; |
47 | 45 |
48 m_private.reset(new SurroundingText(VisiblePosition(node->renderer()->positi
onForPoint(static_cast<IntPoint>(nodePoint))).deepEquivalent().parentAnchoredEqu
ivalent(), maxLength)); | 46 m_private.reset(new SurroundingText(VisiblePosition(node->renderer()->positi
onForPoint(static_cast<IntPoint>(nodePoint))).deepEquivalent().parentAnchoredEqu
ivalent(), maxLength)); |
49 } | 47 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 { | 82 { |
85 return !m_private.get(); | 83 return !m_private.get(); |
86 } | 84 } |
87 | 85 |
88 void WebSurroundingText::reset() | 86 void WebSurroundingText::reset() |
89 { | 87 { |
90 m_private.reset(0); | 88 m_private.reset(0); |
91 } | 89 } |
92 | 90 |
93 } // namespace blink | 91 } // namespace blink |
OLD | NEW |