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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 1912993002: MacViews: Implement NSResponder deletion action messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change "Depends on Patchset". Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index 6d72fef5cf7ece1d35262f4b7b1a572622710f05..c6bfe7021e2a38fa3384d2111949faf47495c1b0 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -567,6 +567,9 @@ gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client,
// TODO(tapted): Make this list complete, except for insert* methods which are
// dispatched as regular key events in doCommandBySelector:.
+// views::Textfields are single-line only, map Paragraph and Document commands
+// to Line.
+
// The insertText action message forwards to the TextInputClient unless a menu
// is active. Note that NSResponder's interpretKeyEvents: implementation doesn't
// direct insertText: through doCommandBySelector:, so this is still needed to
@@ -706,6 +709,28 @@ gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client,
eventFlags:ui::EF_CONTROL_DOWN];
}
+- (void)deleteToBeginningOfLine:(id)sender {
+ [self handleAction:IDS_DELETE_TO_BEGINNING_OF_LINE
+ keyCode:ui::VKEY_BACK
+ domCode:ui::DomCode::BACKSPACE
+ eventFlags:ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN];
+}
+
+- (void)deleteToEndOfLine:(id)sender {
+ [self handleAction:IDS_DELETE_TO_END_OF_LINE
+ keyCode:ui::VKEY_DELETE
+ domCode:ui::DomCode::DEL
+ eventFlags:ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN];
+}
+
+- (void)deleteToBeginningOfParagraph:(id)sender {
+ [self deleteToBeginningOfLine:sender];
+}
+
+- (void)deleteToEndOfParagraph:(id)sender {
+ [self deleteToEndOfLine:sender];
+}
+
// Cancellation.
- (void)cancelOperation:(id)sender {
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698