Chromium Code Reviews| Index: ui/gfx/text_constants.h |
| diff --git a/ui/gfx/text_constants.h b/ui/gfx/text_constants.h |
| index b09081dd8a0b51fd955f319e665a2ced94634503..655c93cc30467484c6f0a31ccb7f75da206272ac 100644 |
| --- a/ui/gfx/text_constants.h |
| +++ b/ui/gfx/text_constants.h |
| @@ -15,6 +15,37 @@ enum BreakType { |
| LINE_BREAK, // Stop cursor movement on line ends as shown on screen. |
| }; |
| +// Specifies the selection behavior for a move/move-and-select command. For |
| +// example consider the state "ab|cd|e", i.e. cd is selected. Assume the |
| +// selection direction is from left to right. If we move to the beginning of the |
| +// line (LINE_BREAK, CURSOR_LEFT), the resultant state is: |
| +// "|ab|cde" for SELECTION_RETAIN, selection direction from right to left. |
| +// "|abcd|e" for SELECTION_EXTEND, selection direction from right to left. |
| +// "ab|cde" for SELECTION_CARET. |
| +// "|abcde" for SELECTION_NONE. |
| +enum SelectionBehavior { |
| + // Default behavior for a move-and-select command. The selection start point |
| + // remains the same. For example, this is the behavior of textfields on Mac |
| + // for the command moveUpAndModifySelection (Shift + Up). |
| + SELECTION_RETAIN, |
|
karandeepb
2016/08/16 10:24:52
This needs a better name, maybe?
msw
2016/08/16 18:37:58
I think it's okay, it retains the start position.
karandeepb
2016/08/17 04:37:22
Acknowledged.
|
| + |
| + // Use for move-and-select commands which want the existing selection to be |
|
msw
2016/08/16 18:37:58
nit: s/which/that/
karandeepb
2016/08/17 04:37:22
Done.
|
| + // extended in the opposite direction, when the selection direction is |
| + // reversed. For example, this is the behavior for textfields on Mac for the |
| + // command moveToLeftEndOfLineAndModifySelection (Command + Shift + Left). |
| + SELECTION_EXTEND, |
| + |
| + // Use for move-and-select commands which want the existing selection to |
|
msw
2016/08/16 18:37:58
nit: s/which/that/
karandeepb
2016/08/17 04:37:22
Done.
|
| + // reduce to a caret, when the selection direction is reversed. For example, |
| + // this is the behavior for textfields on Mac for the command |
| + // moveWordLeftAndModifySelection (Alt + Shift + Left). |
| + SELECTION_CARET, |
| + |
| + // No selection. To be used for move commands, which don't want to cause a |
|
msw
2016/08/16 18:37:58
nit: s/which/that/ and remove the comma after comm
karandeepb
2016/08/17 04:37:22
Done.
|
| + // selection. |
|
msw
2016/08/16 18:37:58
nit: "selection, and which want to collapse any pr
karandeepb
2016/08/17 04:37:22
Done.
|
| + SELECTION_NONE, |
| +}; |
| + |
| // Specifies the word wrapping behavior when a word would exceed the available |
| // display width. All words that are too wide will be put on a new line, and |
| // then: |