| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool ShouldAlwaysGrowSelectionWhenExtendingToBoundary() const { | 75 bool ShouldAlwaysGrowSelectionWhenExtendingToBoundary() const { |
| 76 return type_ == kEditingMacBehavior; | 76 return type_ == kEditingMacBehavior; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // On Mac, when processing a contextual click, the object being clicked upon | 79 // On Mac, when processing a contextual click, the object being clicked upon |
| 80 // should be selected. | 80 // should be selected. |
| 81 bool ShouldSelectOnContextualMenuClick() const { | 81 bool ShouldSelectOnContextualMenuClick() const { |
| 82 return type_ == kEditingMacBehavior; | 82 return type_ == kEditingMacBehavior; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // On Mac and Windows, pressing backspace (when it isn't handled otherwise) | |
| 86 // should navigate back. | |
| 87 bool ShouldNavigateBackOnBackspace() const { | |
| 88 return type_ != kEditingUnixBehavior && type_ != kEditingAndroidBehavior; | |
| 89 } | |
| 90 | |
| 91 // On Mac, selecting backwards by word/line from the middle of a word/line, | 85 // On Mac, selecting backwards by word/line from the middle of a word/line, |
| 92 // and then going forward leaves the caret back in the middle with no | 86 // and then going forward leaves the caret back in the middle with no |
| 93 // selection, instead of directly selecting to the other end of the line/word | 87 // selection, instead of directly selecting to the other end of the line/word |
| 94 // (Unix/Windows behavior). | 88 // (Unix/Windows behavior). |
| 95 bool ShouldExtendSelectionByWordOrLineAcrossCaret() const { | 89 bool ShouldExtendSelectionByWordOrLineAcrossCaret() const { |
| 96 return type_ != kEditingMacBehavior; | 90 return type_ != kEditingMacBehavior; |
| 97 } | 91 } |
| 98 | 92 |
| 99 // Based on native behavior, when using ctrl(alt)+arrow to move caret by word, | 93 // Based on native behavior, when using ctrl(alt)+arrow to move caret by word, |
| 100 // ctrl(alt)+left arrow moves caret to immediately before the word in all | 94 // ctrl(alt)+left arrow moves caret to immediately before the word in all |
| (...skipping 24 matching lines...) Expand all Loading... |
| 125 | 119 |
| 126 bool ShouldInsertCharacter(const KeyboardEvent&) const; | 120 bool ShouldInsertCharacter(const KeyboardEvent&) const; |
| 127 | 121 |
| 128 private: | 122 private: |
| 129 EditingBehaviorType type_; | 123 EditingBehaviorType type_; |
| 130 }; | 124 }; |
| 131 | 125 |
| 132 } // namespace blink | 126 } // namespace blink |
| 133 | 127 |
| 134 #endif // EditingBehavior_h | 128 #endif // EditingBehavior_h |
| OLD | NEW |