Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(904)

Side by Side Diff: Source/core/editing/PositionWithAffinity.cpp

Issue 1299873002: ALL-IN-ONE Introduce enum class TextAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:08:52 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/editing/PositionWithAffinity.h ('k') | Source/core/editing/RenderedPosition.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 #include "core/editing/PositionWithAffinity.h" 6 #include "core/editing/PositionWithAffinity.h"
7 7
8 namespace blink { 8 namespace blink {
9 9
10 template <typename Strategy> 10 template <typename Strategy>
11 PositionWithAffinityTemplate<Strategy>::PositionWithAffinityTemplate(const Posit ionAlgorithm<Strategy>& position, EAffinity affinity) 11 PositionWithAffinityTemplate<Strategy>::PositionWithAffinityTemplate(const Posit ionAlgorithm<Strategy>& position, TextAffinity affinity)
12 : m_position(position) 12 : m_position(position)
13 , m_affinity(affinity) 13 , m_affinity(affinity)
14 { 14 {
15 } 15 }
16 16
17 template <typename Strategy> 17 template <typename Strategy>
18 PositionWithAffinityTemplate<Strategy>::PositionWithAffinityTemplate() 18 PositionWithAffinityTemplate<Strategy>::PositionWithAffinityTemplate()
19 : m_affinity(DOWNSTREAM) 19 : m_affinity(TextAffinity::Downstream)
20 { 20 {
21 } 21 }
22 22
23 template <typename Strategy> 23 template <typename Strategy>
24 PositionWithAffinityTemplate<Strategy>::~PositionWithAffinityTemplate() 24 PositionWithAffinityTemplate<Strategy>::~PositionWithAffinityTemplate()
25 { 25 {
26 } 26 }
27 27
28 template <typename Strategy> 28 template <typename Strategy>
29 bool PositionWithAffinityTemplate<Strategy>::operator==(const PositionWithAffini tyTemplate& other) const 29 bool PositionWithAffinityTemplate<Strategy>::operator==(const PositionWithAffini tyTemplate& other) const
30 { 30 {
31 if (isNull()) 31 if (isNull())
32 return other.isNull(); 32 return other.isNull();
33 return m_affinity == other.m_affinity && m_position == other.m_position; 33 return m_affinity == other.m_affinity && m_position == other.m_position;
34 } 34 }
35 35
36 template class CORE_TEMPLATE_EXPORT PositionWithAffinityTemplate<EditingStrategy >; 36 template class CORE_TEMPLATE_EXPORT PositionWithAffinityTemplate<EditingStrategy >;
37 template class CORE_TEMPLATE_EXPORT PositionWithAffinityTemplate<EditingInCompos edTreeStrategy>; 37 template class CORE_TEMPLATE_EXPORT PositionWithAffinityTemplate<EditingInCompos edTreeStrategy>;
38 38
39 } // namespace blink 39 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/PositionWithAffinity.h ('k') | Source/core/editing/RenderedPosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698