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

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

Issue 2338923003: MacOS handle cmd+V directly in WebKit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_builders_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved.
3 * Copyright (C) 2012 Google, Inc. All rights reserved. 3 * Copyright (C) 2012 Google, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Note: We cannot use DomKey for printable keys since it may vary based on 74 // Note: We cannot use DomKey for printable keys since it may vary based on
75 // locale. 75 // locale.
76 struct DomKeyKeyDownEntry { 76 struct DomKeyKeyDownEntry {
77 const char* key; 77 const char* key;
78 unsigned modifiers; 78 unsigned modifiers;
79 const char* name; 79 const char* name;
80 }; 80 };
81 81
82 // Key bindings with command key on Mac and alt key on other platforms are 82 // Key bindings with command key on Mac and alt key on other platforms are
83 // marked as system key events and will be ignored (with the exception 83 // marked as system key events and will be ignored (with the exception
84 // of Command-B and Command-I) so they shouldn't be added here. 84 // of Command-B, Command-I and Command-V) so they shouldn't be added here.
85 const KeyboardCodeKeyDownEntry kKeyboardCodeKeyDownEntries[] = { 85 const KeyboardCodeKeyDownEntry kKeyboardCodeKeyDownEntries[] = {
86 { VKEY_LEFT, 0, "MoveLeft" }, 86 { VKEY_LEFT, 0, "MoveLeft" },
87 { VKEY_LEFT, ShiftKey, "MoveLeftAndModifySelection" }, 87 { VKEY_LEFT, ShiftKey, "MoveLeftAndModifySelection" },
88 #if OS(MACOSX) 88 #if OS(MACOSX)
89 { VKEY_LEFT, OptionKey, "MoveWordLeft" }, 89 { VKEY_LEFT, OptionKey, "MoveWordLeft" },
90 { VKEY_LEFT, OptionKey | ShiftKey, 90 { VKEY_LEFT, OptionKey | ShiftKey,
91 "MoveWordLeftAndModifySelection" }, 91 "MoveWordLeftAndModifySelection" },
92 #else 92 #else
93 { VKEY_LEFT, CtrlKey, "MoveWordLeft" }, 93 { VKEY_LEFT, CtrlKey, "MoveWordLeft" },
94 { VKEY_LEFT, CtrlKey | ShiftKey, 94 { VKEY_LEFT, CtrlKey | ShiftKey,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #if OS(MACOSX) 142 #if OS(MACOSX)
143 { VKEY_BACK, OptionKey, "DeleteWordBackward" }, 143 { VKEY_BACK, OptionKey, "DeleteWordBackward" },
144 { VKEY_DELETE, OptionKey, "DeleteWordForward" }, 144 { VKEY_DELETE, OptionKey, "DeleteWordForward" },
145 #else 145 #else
146 { VKEY_BACK, CtrlKey, "DeleteWordBackward" }, 146 { VKEY_BACK, CtrlKey, "DeleteWordBackward" },
147 { VKEY_DELETE, CtrlKey, "DeleteWordForward" }, 147 { VKEY_DELETE, CtrlKey, "DeleteWordForward" },
148 #endif 148 #endif
149 #if OS(MACOSX) 149 #if OS(MACOSX)
150 { 'B', CommandKey, "ToggleBold" }, 150 { 'B', CommandKey, "ToggleBold" },
151 { 'I', CommandKey, "ToggleItalic" }, 151 { 'I', CommandKey, "ToggleItalic" },
152 { 'V', CommandKey, "Paste" },
152 #else 153 #else
153 { 'B', CtrlKey, "ToggleBold" }, 154 { 'B', CtrlKey, "ToggleBold" },
154 { 'I', CtrlKey, "ToggleItalic" }, 155 { 'I', CtrlKey, "ToggleItalic" },
155 #endif 156 #endif
156 { 'U', CtrlKey, "ToggleUnderline" }, 157 { 'U', CtrlKey, "ToggleUnderline" },
157 { VKEY_ESCAPE, 0, "Cancel" }, 158 { VKEY_ESCAPE, 0, "Cancel" },
158 { VKEY_OEM_PERIOD, CtrlKey, "Cancel" }, 159 { VKEY_OEM_PERIOD, CtrlKey, "Cancel" },
159 { VKEY_TAB, 0, "InsertTab" }, 160 { VKEY_TAB, 0, "InsertTab" },
160 { VKEY_TAB, ShiftKey, "InsertBacktab" }, 161 { VKEY_TAB, ShiftKey, "InsertBacktab" },
161 { VKEY_RETURN, 0, "InsertNewline" }, 162 { VKEY_RETURN, 0, "InsertNewline" },
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (event.metaKey()) 280 if (event.metaKey())
280 return false; 281 return false;
281 #endif 282 #endif
282 } 283 }
283 #endif 284 #endif
284 285
285 return true; 286 return true;
286 } 287 }
287 } // namespace blink 288 } // namespace blink
288 289
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_builders_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698