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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2777863003: [InputEvent] Distinguish between soft line and hard line (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 InputEvent::InputType inputType) { 85 InputEvent::InputType inputType) {
86 using InputType = InputEvent::InputType; 86 using InputType = InputEvent::InputType;
87 switch (inputType) { 87 switch (inputType) {
88 case InputType::InsertText: 88 case InputType::InsertText:
89 case InputType::InsertLineBreak: 89 case InputType::InsertLineBreak:
90 case InputType::InsertParagraph: 90 case InputType::InsertParagraph:
91 case InputType::InsertCompositionText: 91 case InputType::InsertCompositionText:
92 case InputType::InsertReplacementText: 92 case InputType::InsertReplacementText:
93 case InputType::DeleteWordBackward: 93 case InputType::DeleteWordBackward:
94 case InputType::DeleteWordForward: 94 case InputType::DeleteWordForward:
95 case InputType::DeleteLineBackward: 95 case InputType::DeleteSoftLineBackward:
96 case InputType::DeleteLineForward: 96 case InputType::DeleteSoftLineForward:
97 case InputType::DeleteHardLineBackward:
98 case InputType::DeleteHardLineForward:
97 case InputType::DeleteContentBackward: 99 case InputType::DeleteContentBackward:
98 case InputType::DeleteContentForward: 100 case InputType::DeleteContentForward:
99 return InputEvent::EventCancelable::NotCancelable; 101 return InputEvent::EventCancelable::NotCancelable;
100 default: 102 default:
101 return InputEvent::EventCancelable::IsCancelable; 103 return InputEvent::EventCancelable::IsCancelable;
102 } 104 }
103 } 105 }
104 106
105 } // namespace 107 } // namespace
106 108
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 2131
2130 InputEvent::InputType deletionInputTypeFromTextGranularity( 2132 InputEvent::InputType deletionInputTypeFromTextGranularity(
2131 DeleteDirection direction, 2133 DeleteDirection direction,
2132 TextGranularity granularity) { 2134 TextGranularity granularity) {
2133 using InputType = InputEvent::InputType; 2135 using InputType = InputEvent::InputType;
2134 switch (direction) { 2136 switch (direction) {
2135 case DeleteDirection::Forward: 2137 case DeleteDirection::Forward:
2136 if (granularity == WordGranularity) 2138 if (granularity == WordGranularity)
2137 return InputType::DeleteWordForward; 2139 return InputType::DeleteWordForward;
2138 if (granularity == LineBoundary) 2140 if (granularity == LineBoundary)
2139 return InputType::DeleteLineForward; 2141 return InputType::DeleteSoftLineForward;
2142 if (granularity == ParagraphBoundary)
2143 return InputType::DeleteHardLineForward;
2140 return InputType::DeleteContentForward; 2144 return InputType::DeleteContentForward;
2141 case DeleteDirection::Backward: 2145 case DeleteDirection::Backward:
2142 if (granularity == WordGranularity) 2146 if (granularity == WordGranularity)
2143 return InputType::DeleteWordBackward; 2147 return InputType::DeleteWordBackward;
2144 if (granularity == LineBoundary) 2148 if (granularity == LineBoundary)
2145 return InputType::DeleteLineBackward; 2149 return InputType::DeleteSoftLineBackward;
2150 if (granularity == ParagraphBoundary)
2151 return InputType::DeleteHardLineBackward;
2146 return InputType::DeleteContentBackward; 2152 return InputType::DeleteContentBackward;
2147 default: 2153 default:
2148 return InputType::None; 2154 return InputType::None;
2149 } 2155 }
2150 } 2156 }
2151 2157
2152 } // namespace blink 2158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698