Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) |
|
tkent
2015/08/19 09:50:52
Is this used now?
yosin_UTC9
2015/08/19 10:03:18
Not sure. I'll check and submit another patch if p
| |
| 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) |
|
tkent
2015/08/19 09:50:52
Ditto.
yosin_UTC9
2015/08/19 10:03:18
Not sure. I'll check and submit another patch if p
| |
| 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 |
| OLD | NEW |