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

Side by Side Diff: Source/core/editing/TextAffinity.h

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/RenderedPosition.cpp ('k') | Source/core/editing/VisiblePosition.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 /* 1 /*
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004 Apple Computer, 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 18 matching lines...) Expand all
29 #ifdef __OBJC__ 29 #ifdef __OBJC__
30 #include <AppKit/NSTextView.h> 30 #include <AppKit/NSTextView.h>
31 #endif 31 #endif
32 32
33 namespace blink { 33 namespace blink {
34 34
35 // These match the AppKit values for these concepts. 35 // These match the AppKit values for these concepts.
36 // From NSTextView.h: 36 // From NSTextView.h:
37 // NSSelectionAffinityUpstream = 0 37 // NSSelectionAffinityUpstream = 0
38 // NSSelectionAffinityDownstream = 1 38 // NSSelectionAffinityDownstream = 1
39 // TODO(yosin) We should rename |UPSTREAM| and |DOWNSTREAM| to use 39 enum class TextAffinity { Upstream = 0, Downstream = 1 };
40 // capitalized name.
41 enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 }; // NOLINT
42 40
43 } // namespace blink 41 } // namespace blink
44 42
45 #ifdef __OBJC__ 43 #ifdef __OBJC__
46 44
47 inline NSSelectionAffinity kit(blink::EAffinity affinity) 45 inline NSSelectionAffinity kit(blink::TextAffinity affinity)
48 { 46 {
49 return static_cast<NSSelectionAffinity>(affinity); 47 return static_cast<NSSelectionAffinity>(affinity);
50 } 48 }
51 49
52 inline blink::EAffinity core(NSSelectionAffinity affinity) 50 inline blink::TextAffinity core(NSSelectionAffinity affinity)
53 { 51 {
54 return static_cast<blink::EAffinity>(affinity); 52 return static_cast<blink::TextAffinity>(affinity);
55 } 53 }
56 54
57 #endif 55 #endif
58 56
59 #endif // TextAffinity_h 57 #endif // TextAffinity_h
OLDNEW
« no previous file with comments | « Source/core/editing/RenderedPosition.cpp ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698