Index: ui/gfx/text_constants.h |
diff --git a/ui/gfx/text_constants.h b/ui/gfx/text_constants.h |
index 93450ea56070d6957379e15733ac24ab14c2d131..1bf48ec05fbacf3b6f295b3660d29a1d86b12eb2 100644 |
--- a/ui/gfx/text_constants.h |
+++ b/ui/gfx/text_constants.h |
@@ -15,6 +15,34 @@ enum BreakType { |
LINE_BREAK, // Stop cursor movement on line ends as shown on screen. |
}; |
+// Specifies how a move and select command behaves if the selection direction |
+// is reversed. 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 while modifying the selection, the resultant state is: |
+// "|ab|cde" for SELECTION_START_NEW, selection direction from right to left. |
+// "|abcd|e" for SELECTION_EXTEND, selection direction from right to left. |
+// "ab|cde" for SELECTION_CARET. |
+enum SelectionReversedBehavior { |
+ // Existing selection is deselcted and a new selection is started in the |
+ // opposite direction. Default. For example, this is the behavior of |
+ // textfields on Mac for the command moveUpAndModifySelection (Shift + Up). |
+ // Also this is the default behavior for text editing commands on Linux and |
+ // Windows. |
+ SELECTION_START_NEW, |
+ |
+ // The existing selection is extended in the opposite direction. For example, |
+ // this is the behavior for textfields on Mac for the command |
+ // moveToLeftEndOfLineAndModifySelection (Command + Shift + Left). |
+ SELECTION_EXTEND, |
+ |
+ // The existing selection reduces to a caret. For example, this is the |
+ // behavior for textfields on Mac for the command |
+ // moveWordLeftAndModifySelection (Alt + Shift + Left). |
tapted
2016/05/25 04:31:06
Is there a rule we can follow for these without ha
karandeepb
2016/05/25 05:04:11
Yes SELECTION_CARET can be inferred from WORD_BREA
|
+ SELECTION_CARET, |
+ |
+ SELECTION_DEFAULT = SELECTION_START_NEW, |
+}; |
+ |
// 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: |