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

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

Issue 1406713002: Make queryCommandSupported(copy|cut|paste) always return true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-10-14T18:29:33 Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2009 Igalia S.L. 4 * Copyright (C) 2009 Igalia S.L.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 return EphemeralRange(startPosition, endPosition); 288 return EphemeralRange(startPosition, endPosition);
289 } 289 }
290 290
291 // Execute command functions 291 // Execute command functions
292 292
293 static bool executeBackColor(LocalFrame& frame, Event*, EditorCommandSource sour ce, const String& value) 293 static bool executeBackColor(LocalFrame& frame, Event*, EditorCommandSource sour ce, const String& value)
294 { 294 {
295 return executeApplyStyle(frame, source, EditActionSetBackgroundColor, CSSPro pertyBackgroundColor, value); 295 return executeApplyStyle(frame, source, EditActionSetBackgroundColor, CSSPro pertyBackgroundColor, value);
296 } 296 }
297 297
298 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource, const St ring&) 298 static bool canWriteClipboard(LocalFrame& frame, EditorCommandSource source)
299 { 299 {
300 if (source == CommandFromMenuOrKeyBinding)
301 return true;
302 Settings* settings = frame.settings();
303 bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) | | UserGestureIndicator::processingUserGesture();
304 return frame.editor().client().canCopyCut(&frame, defaultValue);
305 }
306
307 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource source, c onst String&)
308 {
309 if (!canWriteClipboard(frame, source))
dcheng 2015/10/14 16:47:37 How come we need to do another check here? It look
yosin_UTC9 2015/10/15 01:30:47 Copy/Cut/Paste are only commands executing even if
dcheng 2015/10/15 06:10:30 Let's add a comment that we need to do these check
yosin_UTC9 2015/10/15 08:18:55 Added comments.
310 return false;
300 frame.editor().copy(); 311 frame.editor().copy();
301 return true; 312 return true;
302 } 313 }
303 314
304 static bool executeCreateLink(LocalFrame& frame, Event*, EditorCommandSource, co nst String& value) 315 static bool executeCreateLink(LocalFrame& frame, Event*, EditorCommandSource, co nst String& value)
305 { 316 {
306 if (value.isEmpty()) 317 if (value.isEmpty())
307 return false; 318 return false;
308 ASSERT(frame.document()); 319 ASSERT(frame.document());
309 CreateLinkCommand::create(*frame.document(), value)->apply(); 320 CreateLinkCommand::create(*frame.document(), value)->apply();
310 return true; 321 return true;
311 } 322 }
312 323
313 static bool executeCut(LocalFrame& frame, Event*, EditorCommandSource, const Str ing&) 324 static bool executeCut(LocalFrame& frame, Event*, EditorCommandSource source, co nst String&)
314 { 325 {
326 if (!canWriteClipboard(frame, source))
327 return false;
315 frame.editor().cut(); 328 frame.editor().cut();
316 return true; 329 return true;
317 } 330 }
318 331
319 static bool executeDefaultParagraphSeparator(LocalFrame& frame, Event*, EditorCo mmandSource, const String& value) 332 static bool executeDefaultParagraphSeparator(LocalFrame& frame, Event*, EditorCo mmandSource, const String& value)
320 { 333 {
321 if (equalIgnoringCase(value, "div")) 334 if (equalIgnoringCase(value, "div"))
322 frame.editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsDi v); 335 frame.editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsDi v);
323 else if (equalIgnoringCase(value, "p")) 336 else if (equalIgnoringCase(value, "p"))
324 frame.editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsP) ; 337 frame.editor().setDefaultParagraphSeparator(EditorParagraphSeparatorIsP) ;
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 IndentOutdentCommand::create(*frame.document(), IndentOutdentCommand::Outden t)->apply(); 947 IndentOutdentCommand::create(*frame.document(), IndentOutdentCommand::Outden t)->apply();
935 return true; 948 return true;
936 } 949 }
937 950
938 static bool executeToggleOverwrite(LocalFrame& frame, Event*, EditorCommandSourc e, const String&) 951 static bool executeToggleOverwrite(LocalFrame& frame, Event*, EditorCommandSourc e, const String&)
939 { 952 {
940 frame.editor().toggleOverwriteModeEnabled(); 953 frame.editor().toggleOverwriteModeEnabled();
941 return true; 954 return true;
942 } 955 }
943 956
944 static bool executePaste(LocalFrame& frame, Event*, EditorCommandSource, const S tring&) 957 static bool canReadClipboard(LocalFrame& frame, EditorCommandSource source)
945 { 958 {
959 if (source == CommandFromMenuOrKeyBinding)
960 return true;
961 Settings* settings = frame.settings();
962 bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed();
963 return frame.editor().client().canPaste(&frame, defaultValue);
964 }
965
966 static bool executePaste(LocalFrame& frame, Event*, EditorCommandSource source, const String&)
967 {
968 if (!canReadClipboard(frame, source))
969 return false;
946 frame.editor().paste(); 970 frame.editor().paste();
947 return true; 971 return true;
948 } 972 }
949 973
950 static bool executePasteGlobalSelection(LocalFrame& frame, Event*, EditorCommand Source source, const String&) 974 static bool executePasteGlobalSelection(LocalFrame& frame, Event*, EditorCommand Source source, const String&)
951 { 975 {
976 if (!canReadClipboard(frame, source))
977 return false;
952 if (!frame.editor().behavior().supportsGlobalSelection()) 978 if (!frame.editor().behavior().supportsGlobalSelection())
953 return false; 979 return false;
954 ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding); 980 ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding);
955 981
956 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 982 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
957 Pasteboard::generalPasteboard()->setSelectionMode(true); 983 Pasteboard::generalPasteboard()->setSelectionMode(true);
958 frame.editor().paste(); 984 frame.editor().paste();
959 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 985 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
960 return true; 986 return true;
961 } 987 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 static bool supported(LocalFrame*) 1189 static bool supported(LocalFrame*)
1164 { 1190 {
1165 return true; 1191 return true;
1166 } 1192 }
1167 1193
1168 static bool supportedFromMenuOrKeyBinding(LocalFrame*) 1194 static bool supportedFromMenuOrKeyBinding(LocalFrame*)
1169 { 1195 {
1170 return false; 1196 return false;
1171 } 1197 }
1172 1198
1173 static bool supportedCopyCut(LocalFrame* frame)
1174 {
1175 if (!frame)
1176 return false;
1177
1178 Settings* settings = frame->settings();
1179 bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) | | UserGestureIndicator::processingUserGesture();
1180 return frame->editor().client().canCopyCut(frame, defaultValue);
1181 }
1182
1183 static bool supportedPaste(LocalFrame* frame)
1184 {
1185 if (!frame)
1186 return false;
1187
1188 Settings* settings = frame->settings();
1189 bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed();
1190 return frame->editor().client().canPaste(frame, defaultValue);
1191 }
1192
1193 // Enabled functions 1199 // Enabled functions
1194 1200
1195 static bool enabled(LocalFrame&, Event*, EditorCommandSource) 1201 static bool enabled(LocalFrame&, Event*, EditorCommandSource)
1196 { 1202 {
1197 return true; 1203 return true;
1198 } 1204 }
1199 1205
1200 static bool enabledVisibleSelection(LocalFrame& frame, Event* event, EditorComma ndSource) 1206 static bool enabledVisibleSelection(LocalFrame& frame, Event* event, EditorComma ndSource)
1201 { 1207 {
1202 // The term "visible" here includes a caret in editable text or a range in a ny text. 1208 // The term "visible" here includes a caret in editable text or a range in a ny text.
(...skipping 20 matching lines...) Expand all
1223 return ((selection.isCaret() && selection.isContentEditable()) || selection. isRange()) 1229 return ((selection.isCaret() && selection.isContentEditable()) || selection. isRange())
1224 && frame.editor().mark().isCaretOrRange(); 1230 && frame.editor().mark().isCaretOrRange();
1225 } 1231 }
1226 1232
1227 static bool enableCaretInEditableText(LocalFrame& frame, Event* event, EditorCom mandSource) 1233 static bool enableCaretInEditableText(LocalFrame& frame, Event* event, EditorCom mandSource)
1228 { 1234 {
1229 const VisibleSelection& selection = frame.editor().selectionForCommand(event ); 1235 const VisibleSelection& selection = frame.editor().selectionForCommand(event );
1230 return selection.isCaret() && selection.isContentEditable(); 1236 return selection.isCaret() && selection.isContentEditable();
1231 } 1237 }
1232 1238
1233 static bool enabledCopy(LocalFrame& frame, Event*, EditorCommandSource) 1239 static bool enabledCopy(LocalFrame& frame, Event*, EditorCommandSource source)
1234 { 1240 {
1241 if (!canWriteClipboard(frame, source))
1242 return false;
1235 return frame.editor().canDHTMLCopy() || frame.editor().canCopy(); 1243 return frame.editor().canDHTMLCopy() || frame.editor().canCopy();
1236 } 1244 }
1237 1245
1238 static bool enabledCut(LocalFrame& frame, Event*, EditorCommandSource) 1246 static bool enabledCut(LocalFrame& frame, Event*, EditorCommandSource source)
1239 { 1247 {
1248 if (!canWriteClipboard(frame, source))
1249 return false;
1240 return frame.editor().canDHTMLCut() || frame.editor().canCut(); 1250 return frame.editor().canDHTMLCut() || frame.editor().canCut();
1241 } 1251 }
1242 1252
1243 static bool enabledInEditableText(LocalFrame& frame, Event* event, EditorCommand Source) 1253 static bool enabledInEditableText(LocalFrame& frame, Event* event, EditorCommand Source)
1244 { 1254 {
1245 return frame.editor().selectionForCommand(event).rootEditableElement(); 1255 return frame.editor().selectionForCommand(event).rootEditableElement();
1246 } 1256 }
1247 1257
1248 static bool enabledDelete(LocalFrame& frame, Event* event, EditorCommandSource s ource) 1258 static bool enabledDelete(LocalFrame& frame, Event* event, EditorCommandSource s ource)
1249 { 1259 {
(...skipping 13 matching lines...) Expand all
1263 { 1273 {
1264 // The EditorCommandSource parameter is unused in enabledInEditableText, so just pass a dummy variable 1274 // The EditorCommandSource parameter is unused in enabledInEditableText, so just pass a dummy variable
1265 return caretBrowsingEnabled(frame) || enabledInEditableText(frame, event, du mmyEditorCommandSource); 1275 return caretBrowsingEnabled(frame) || enabledInEditableText(frame, event, du mmyEditorCommandSource);
1266 } 1276 }
1267 1277
1268 static bool enabledInRichlyEditableText(LocalFrame& frame, Event*, EditorCommand Source) 1278 static bool enabledInRichlyEditableText(LocalFrame& frame, Event*, EditorCommand Source)
1269 { 1279 {
1270 return frame.selection().isCaretOrRange() && frame.selection().isContentRich lyEditable() && frame.selection().rootEditableElement(); 1280 return frame.selection().isCaretOrRange() && frame.selection().isContentRich lyEditable() && frame.selection().rootEditableElement();
1271 } 1281 }
1272 1282
1273 static bool enabledPaste(LocalFrame& frame, Event*, EditorCommandSource) 1283 static bool enabledPaste(LocalFrame& frame, Event*, EditorCommandSource source)
1274 { 1284 {
1285 if (!canReadClipboard(frame, source))
1286 return false;
1275 return frame.editor().canPaste(); 1287 return frame.editor().canPaste();
1276 } 1288 }
1277 1289
1278 static bool enabledRangeInEditableText(LocalFrame& frame, Event*, EditorCommandS ource) 1290 static bool enabledRangeInEditableText(LocalFrame& frame, Event*, EditorCommandS ource)
1279 { 1291 {
1280 return frame.selection().isRange() && frame.selection().isContentEditable(); 1292 return frame.selection().isRange() && frame.selection().isContentEditable();
1281 } 1293 }
1282 1294
1283 static bool enabledRangeInRichlyEditableText(LocalFrame& frame, Event*, EditorCo mmandSource) 1295 static bool enabledRangeInRichlyEditableText(LocalFrame& frame, Event*, EditorCo mmandSource)
1284 { 1296 {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 // If you add new commands, you should assign new Id to each idForUserMetric s and update MappedEditingCommands 1462 // If you add new commands, you should assign new Id to each idForUserMetric s and update MappedEditingCommands
1451 // in chrome/trunk/src/tools/metrics/histograms/histograms.xml. 1463 // in chrome/trunk/src/tools/metrics/histograms/histograms.xml.
1452 static const CommandEntry commands[] = { 1464 static const CommandEntry commands[] = {
1453 { "AlignCenter", {139, executeJustifyCenter, supportedFromMenuOrKeyBindi ng, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAl lowExecutionWhenDisabled } }, 1465 { "AlignCenter", {139, executeJustifyCenter, supportedFromMenuOrKeyBindi ng, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAl lowExecutionWhenDisabled } },
1454 { "AlignJustified", {1, executeJustifyFull, supportedFromMenuOrKeyBindin g, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAll owExecutionWhenDisabled } }, 1466 { "AlignJustified", {1, executeJustifyFull, supportedFromMenuOrKeyBindin g, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAll owExecutionWhenDisabled } },
1455 { "AlignLeft", {2, executeJustifyLeft, supportedFromMenuOrKeyBinding, en abledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExe cutionWhenDisabled } }, 1467 { "AlignLeft", {2, executeJustifyLeft, supportedFromMenuOrKeyBinding, en abledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExe cutionWhenDisabled } },
1456 { "AlignRight", {3, executeJustifyRight, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowE xecutionWhenDisabled } }, 1468 { "AlignRight", {3, executeJustifyRight, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowE xecutionWhenDisabled } },
1457 { "BackColor", {4, executeBackColor, supported, enabledInRichlyEditableT ext, stateNone, valueBackColor, notTextInsertion, doNotAllowExecutionWhenDisable d } }, 1469 { "BackColor", {4, executeBackColor, supported, enabledInRichlyEditableT ext, stateNone, valueBackColor, notTextInsertion, doNotAllowExecutionWhenDisable d } },
1458 { "BackwardDelete", {5, executeDeleteBackward, supportedFromMenuOrKeyBin ding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowE xecutionWhenDisabled } }, // FIXME: remove BackwardDelete when Safari for Window s stops using it. 1470 { "BackwardDelete", {5, executeDeleteBackward, supportedFromMenuOrKeyBin ding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowE xecutionWhenDisabled } }, // FIXME: remove BackwardDelete when Safari for Window s stops using it.
1459 { "Bold", {6, executeToggleBold, supported, enabledInRichlyEditableText, stateBold, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1471 { "Bold", {6, executeToggleBold, supported, enabledInRichlyEditableText, stateBold, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1460 { "Copy", {7, executeCopy, supportedCopyCut, enabledCopy, stateNone, val ueNull, notTextInsertion, allowExecutionWhenDisabled } }, 1472 { "Copy", {7, executeCopy, supported, enabledCopy, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
1461 { "CreateLink", {8, executeCreateLink, supported, enabledInRichlyEditabl eText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1473 { "CreateLink", {8, executeCreateLink, supported, enabledInRichlyEditabl eText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1462 { "Cut", {9, executeCut, supportedCopyCut, enabledCut, stateNone, valueN ull, notTextInsertion, allowExecutionWhenDisabled } }, 1474 { "Cut", {9, executeCut, supported, enabledCut, stateNone, valueNull, no tTextInsertion, allowExecutionWhenDisabled } },
1463 { "DefaultParagraphSeparator", {10, executeDefaultParagraphSeparator, su pported, enabled, stateNone, valueDefaultParagraphSeparator, notTextInsertion, d oNotAllowExecutionWhenDisabled} }, 1475 { "DefaultParagraphSeparator", {10, executeDefaultParagraphSeparator, su pported, enabled, stateNone, valueDefaultParagraphSeparator, notTextInsertion, d oNotAllowExecutionWhenDisabled} },
1464 { "Delete", {11, executeDelete, supported, enabledDelete, stateNone, val ueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1476 { "Delete", {11, executeDelete, supported, enabledDelete, stateNone, val ueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1465 { "DeleteBackward", {12, executeDeleteBackward, supportedFromMenuOrKeyBi nding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllow ExecutionWhenDisabled } }, 1477 { "DeleteBackward", {12, executeDeleteBackward, supportedFromMenuOrKeyBi nding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllow ExecutionWhenDisabled } },
1466 { "DeleteBackwardByDecomposingPreviousCharacter", {13, executeDeleteBack wardByDecomposingPreviousCharacter, supportedFromMenuOrKeyBinding, enabledInEdit ableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisable d } }, 1478 { "DeleteBackwardByDecomposingPreviousCharacter", {13, executeDeleteBack wardByDecomposingPreviousCharacter, supportedFromMenuOrKeyBinding, enabledInEdit ableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisable d } },
1467 { "DeleteForward", {14, executeDeleteForward, supportedFromMenuOrKeyBind ing, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowEx ecutionWhenDisabled } }, 1479 { "DeleteForward", {14, executeDeleteForward, supportedFromMenuOrKeyBind ing, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowEx ecutionWhenDisabled } },
1468 { "DeleteToBeginningOfLine", {15, executeDeleteToBeginningOfLine, suppor tedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextIns ertion, doNotAllowExecutionWhenDisabled } }, 1480 { "DeleteToBeginningOfLine", {15, executeDeleteToBeginningOfLine, suppor tedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextIns ertion, doNotAllowExecutionWhenDisabled } },
1469 { "DeleteToBeginningOfParagraph", {16, executeDeleteToBeginningOfParagra ph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1481 { "DeleteToBeginningOfParagraph", {16, executeDeleteToBeginningOfParagra ph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1470 { "DeleteToEndOfLine", {17, executeDeleteToEndOfLine, supportedFromMenuO rKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNo tAllowExecutionWhenDisabled } }, 1482 { "DeleteToEndOfLine", {17, executeDeleteToEndOfLine, supportedFromMenuO rKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNo tAllowExecutionWhenDisabled } },
1471 { "DeleteToEndOfParagraph", {18, executeDeleteToEndOfParagraph, supporte dFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInser tion, doNotAllowExecutionWhenDisabled } }, 1483 { "DeleteToEndOfParagraph", {18, executeDeleteToEndOfParagraph, supporte dFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInser tion, doNotAllowExecutionWhenDisabled } },
1472 { "DeleteToMark", {19, executeDeleteToMark, supportedFromMenuOrKeyBindin g, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExec utionWhenDisabled } }, 1484 { "DeleteToMark", {19, executeDeleteToMark, supportedFromMenuOrKeyBindin g, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExec utionWhenDisabled } },
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 { "MoveWordBackward", {93, executeMoveWordBackward, supportedFromMenuOrK eyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextIn sertion, doNotAllowExecutionWhenDisabled } }, 1558 { "MoveWordBackward", {93, executeMoveWordBackward, supportedFromMenuOrK eyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextIn sertion, doNotAllowExecutionWhenDisabled } },
1547 { "MoveWordBackwardAndModifySelection", {94, executeMoveWordBackwardAndM odifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBro wsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1559 { "MoveWordBackwardAndModifySelection", {94, executeMoveWordBackwardAndM odifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBro wsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1548 { "MoveWordForward", {95, executeMoveWordForward, supportedFromMenuOrKey Binding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInse rtion, doNotAllowExecutionWhenDisabled } }, 1560 { "MoveWordForward", {95, executeMoveWordForward, supportedFromMenuOrKey Binding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInse rtion, doNotAllowExecutionWhenDisabled } },
1549 { "MoveWordForwardAndModifySelection", {96, executeMoveWordForwardAndMod ifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrows ing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } } , 1561 { "MoveWordForwardAndModifySelection", {96, executeMoveWordForwardAndMod ifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrows ing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } } ,
1550 { "MoveWordLeft", {97, executeMoveWordLeft, supportedFromMenuOrKeyBindin g, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1562 { "MoveWordLeft", {97, executeMoveWordLeft, supportedFromMenuOrKeyBindin g, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1551 { "MoveWordLeftAndModifySelection", {98, executeMoveWordLeftAndModifySel ection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, s tateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1563 { "MoveWordLeftAndModifySelection", {98, executeMoveWordLeftAndModifySel ection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, s tateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1552 { "MoveWordRight", {99, executeMoveWordRight, supportedFromMenuOrKeyBind ing, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertio n, doNotAllowExecutionWhenDisabled } }, 1564 { "MoveWordRight", {99, executeMoveWordRight, supportedFromMenuOrKeyBind ing, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertio n, doNotAllowExecutionWhenDisabled } },
1553 { "MoveWordRightAndModifySelection", {100, executeMoveWordRightAndModify Selection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing , stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1565 { "MoveWordRightAndModifySelection", {100, executeMoveWordRightAndModify Selection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing , stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1554 { "Outdent", {101, executeOutdent, supported, enabledInRichlyEditableTex t, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1566 { "Outdent", {101, executeOutdent, supported, enabledInRichlyEditableTex t, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1555 { "OverWrite", {102, executeToggleOverwrite, supportedFromMenuOrKeyBindi ng, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAl lowExecutionWhenDisabled } }, 1567 { "OverWrite", {102, executeToggleOverwrite, supportedFromMenuOrKeyBindi ng, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAl lowExecutionWhenDisabled } },
1556 { "Paste", {103, executePaste, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } }, 1568 { "Paste", {103, executePaste, supported, enabledPaste, stateNone, value Null, notTextInsertion, allowExecutionWhenDisabled } },
1557 { "PasteAndMatchStyle", {104, executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisable d } }, 1569 { "PasteAndMatchStyle", {104, executePasteAndMatchStyle, supported, enab ledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } } ,
1558 { "PasteGlobalSelection", {105, executePasteGlobalSelection, supportedFr omMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowE xecutionWhenDisabled } }, 1570 { "PasteGlobalSelection", {105, executePasteGlobalSelection, supportedFr omMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowE xecutionWhenDisabled } },
1559 { "Print", {106, executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1571 { "Print", {106, executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1560 { "Redo", {107, executeRedo, supported, enabledRedo, stateNone, valueNul l, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1572 { "Redo", {107, executeRedo, supported, enabledRedo, stateNone, valueNul l, notTextInsertion, doNotAllowExecutionWhenDisabled } },
1561 { "RemoveFormat", {108, executeRemoveFormat, supported, enabledRangeInEd itableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisab led } }, 1573 { "RemoveFormat", {108, executeRemoveFormat, supported, enabledRangeInEd itableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisab led } },
1562 { "ScrollPageBackward", {109, executeScrollPageBackward, supportedFromMe nuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecu tionWhenDisabled } }, 1574 { "ScrollPageBackward", {109, executeScrollPageBackward, supportedFromMe nuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecu tionWhenDisabled } },
1563 { "ScrollPageForward", {110, executeScrollPageForward, supportedFromMenu OrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecuti onWhenDisabled } }, 1575 { "ScrollPageForward", {110, executeScrollPageForward, supportedFromMenu OrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecuti onWhenDisabled } },
1564 { "ScrollLineUp", {111, executeScrollLineUp, supportedFromMenuOrKeyBindi ng, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisa bled } }, 1576 { "ScrollLineUp", {111, executeScrollLineUp, supportedFromMenuOrKeyBindi ng, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisa bled } },
1565 { "ScrollLineDown", {112, executeScrollLineDown, supportedFromMenuOrKeyB inding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhen Disabled } }, 1577 { "ScrollLineDown", {112, executeScrollLineDown, supportedFromMenuOrKeyB inding, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhen Disabled } },
1566 { "ScrollToBeginningOfDocument", {113, executeScrollToBeginningOfDocumen t, supportedFromMenuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertio n, doNotAllowExecutionWhenDisabled } }, 1578 { "ScrollToBeginningOfDocument", {113, executeScrollToBeginningOfDocumen t, supportedFromMenuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertio n, doNotAllowExecutionWhenDisabled } },
1567 { "ScrollToEndOfDocument", {114, executeScrollToEndOfDocument, supported FromMenuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllo wExecutionWhenDisabled } }, 1579 { "ScrollToEndOfDocument", {114, executeScrollToEndOfDocument, supported FromMenuOrKeyBinding, enabled, stateNone, valueNull, notTextInsertion, doNotAllo wExecutionWhenDisabled } },
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 { 1799 {
1788 return m_command && m_command->isTextInsertion; 1800 return m_command && m_command->isTextInsertion;
1789 } 1801 }
1790 1802
1791 int Editor::Command::idForHistogram() const 1803 int Editor::Command::idForHistogram() const
1792 { 1804 {
1793 return isSupported() ? m_command->idForUserMetrics : 0; 1805 return isSupported() ? m_command->idForUserMetrics : 0;
1794 } 1806 }
1795 1807
1796 } // namespace blink 1808 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698