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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 frame.editor().performDelete(); 586 frame.editor().performDelete();
587 return true; 587 return true;
588 } 588 }
589 case CommandFromDOM: 589 case CommandFromDOM:
590 // If the current selection is a caret, delete the preceding character. IE 590 // If the current selection is a caret, delete the preceding character. IE
591 // performs forwardDelete, but we currently side with Firefox. Doesn't 591 // performs forwardDelete, but we currently side with Firefox. Doesn't
592 // scroll to make the selection visible, or modify the kill ring (this 592 // scroll to make the selection visible, or modify the kill ring (this
593 // time, siding with IE, not Firefox). 593 // time, siding with IE, not Firefox).
594 DCHECK(frame.document()); 594 DCHECK(frame.document());
595 TypingCommand::deleteKeyPressed( 595 TypingCommand::deleteKeyPressed(
596 *frame.document(), frame.selection().granularity() == WordGranularity 596 *frame.document(),
597 ? TypingCommand::SmartDelete 597 frame.selection().granularity() == WordGranularity
598 : 0); 598 ? TypingCommand::SmartDelete
599 : 0);
599 return true; 600 return true;
600 } 601 }
601 NOTREACHED(); 602 NOTREACHED();
602 return false; 603 return false;
603 } 604 }
604 605
605 static bool executeDeleteBackward(LocalFrame& frame, 606 static bool executeDeleteBackward(LocalFrame& frame,
606 Event*, 607 Event*,
607 EditorCommandSource, 608 EditorCommandSource,
608 const String&) { 609 const String&) {
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 NOTREACHED(); 878 NOTREACHED();
878 return false; 879 return false;
879 } 880 }
880 881
881 static bool executeInsertNewline(LocalFrame& frame, 882 static bool executeInsertNewline(LocalFrame& frame,
882 Event* event, 883 Event* event,
883 EditorCommandSource, 884 EditorCommandSource,
884 const String&) { 885 const String&) {
885 LocalFrame* targetFrame = blink::targetFrame(frame, event); 886 LocalFrame* targetFrame = blink::targetFrame(frame, event);
886 return targetFrame->eventHandler().handleTextInputEvent( 887 return targetFrame->eventHandler().handleTextInputEvent(
887 "\n", event, targetFrame->editor().canEditRichly() 888 "\n", event,
888 ? TextEventInputKeyboard 889 targetFrame->editor().canEditRichly() ? TextEventInputKeyboard
889 : TextEventInputLineBreak); 890 : TextEventInputLineBreak);
890 } 891 }
891 892
892 static bool executeInsertNewlineInQuotedContent(LocalFrame& frame, 893 static bool executeInsertNewlineInQuotedContent(LocalFrame& frame,
893 Event*, 894 Event*,
894 EditorCommandSource, 895 EditorCommandSource,
895 const String&) { 896 const String&) {
896 DCHECK(frame.document()); 897 DCHECK(frame.document());
897 return TypingCommand::insertParagraphSeparatorInQuotedContent( 898 return TypingCommand::insertParagraphSeparatorInQuotedContent(
898 *frame.document()); 899 *frame.document());
899 } 900 }
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 *m_frame, DirectionBackward, WordGranularity); 2740 *m_frame, DirectionBackward, WordGranularity);
2740 case WebEditingCommandType::DeleteWordForward: 2741 case WebEditingCommandType::DeleteWordForward:
2741 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, 2742 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward,
2742 WordGranularity); 2743 WordGranularity);
2743 default: 2744 default:
2744 return targetRangesForInputEvent(*target); 2745 return targetRangesForInputEvent(*target);
2745 } 2746 }
2746 } 2747 }
2747 2748
2748 } // namespace blink 2749 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698