| 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 PositionWithAffinity_h | 5 #ifndef PositionWithAffinity_h |
| 6 #define PositionWithAffinity_h | 6 #define PositionWithAffinity_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/editing/Position.h" | 9 #include "core/editing/Position.h" |
| 10 #include "core/editing/TextAffinity.h" | 10 #include "core/editing/TextAffinity.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 template <typename Strategy> | 14 template <typename Strategy> |
| 15 class CORE_TEMPLATE_CLASS_EXPORT PositionWithAffinityTemplate { | 15 class CORE_TEMPLATE_CLASS_EXPORT PositionWithAffinityTemplate { |
| 16 DISALLOW_ALLOCATION(); | 16 DISALLOW_NEW(); |
| 17 public: | 17 public: |
| 18 // TODO(yosin) We should have single parameter constructor not to use | 18 // TODO(yosin) We should have single parameter constructor not to use |
| 19 // default parameter for avoiding include "TextAffinity.h" | 19 // default parameter for avoiding include "TextAffinity.h" |
| 20 PositionWithAffinityTemplate(const PositionTemplate<Strategy>&, TextAffinity
= TextAffinity::Downstream); | 20 PositionWithAffinityTemplate(const PositionTemplate<Strategy>&, TextAffinity
= TextAffinity::Downstream); |
| 21 PositionWithAffinityTemplate(); | 21 PositionWithAffinityTemplate(); |
| 22 ~PositionWithAffinityTemplate(); | 22 ~PositionWithAffinityTemplate(); |
| 23 | 23 |
| 24 TextAffinity affinity() const { return m_affinity; } | 24 TextAffinity affinity() const { return m_affinity; } |
| 25 const PositionTemplate<Strategy>& position() const { return m_position; } | 25 const PositionTemplate<Strategy>& position() const { return m_position; } |
| 26 | 26 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 template <> | 60 template <> |
| 61 inline PositionInComposedTreeWithAffinity fromPositionInDOMTree<EditingInCompose
dTreeStrategy>(const PositionWithAffinity& positionWithAffinity) | 61 inline PositionInComposedTreeWithAffinity fromPositionInDOMTree<EditingInCompose
dTreeStrategy>(const PositionWithAffinity& positionWithAffinity) |
| 62 { | 62 { |
| 63 return PositionInComposedTreeWithAffinity(toPositionInComposedTree(positionW
ithAffinity.position()), positionWithAffinity.affinity()); | 63 return PositionInComposedTreeWithAffinity(toPositionInComposedTree(positionW
ithAffinity.position()), positionWithAffinity.affinity()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| 67 | 67 |
| 68 #endif // PositionWithAffinity_h | 68 #endif // PositionWithAffinity_h |
| OLD | NEW |