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

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

Issue 2642913003: Select All should show handles if they were already present (Closed)
Patch Set: forgot to change enum name in test Created 3 years, 11 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 | « third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp ('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, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * Copyright (C) 2015 Google Inc. All rights reserved. 6 * Copyright (C) 2015 Google Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 newSelection.setIsDirectional(isDirectional); 673 newSelection.setIsDirectional(isDirectional);
674 const bool isHandleVisible = handleVisibility == HandleVisibility::Visible; 674 const bool isHandleVisible = handleVisibility == HandleVisibility::Visible;
675 if (selection().visibleSelection<EditingInFlatTreeStrategy>() == 675 if (selection().visibleSelection<EditingInFlatTreeStrategy>() ==
676 newSelection && 676 newSelection &&
677 selection().isHandleVisible() == isHandleVisible) 677 selection().isHandleVisible() == isHandleVisible)
678 return; 678 return;
679 679
680 const FrameSelection::SetSelectionOptions options = 680 const FrameSelection::SetSelectionOptions options =
681 isHandleVisible 681 isHandleVisible
682 ? FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | 682 ? FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle |
683 FrameSelection::HandleVisible 683 FrameSelection::ShowHandle
684 : FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle; 684 : FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle;
685 685
686 selection().setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded, 686 selection().setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded,
687 granularity); 687 granularity);
688 } 688 }
689 689
690 void SelectionController::setCaretAtHitTestResult( 690 void SelectionController::setCaretAtHitTestResult(
691 const HitTestResult& hitTestResult) { 691 const HitTestResult& hitTestResult) {
692 Node* innerNode = hitTestResult.innerNode(); 692 Node* innerNode = hitTestResult.innerNode();
693 const VisiblePositionInFlatTree& visibleHitPos = 693 const VisiblePositionInFlatTree& visibleHitPos =
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 return event.event().altKey() && event.isOverLink(); 1060 return event.event().altKey() && event.isOverLink();
1061 } 1061 }
1062 1062
1063 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1063 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1064 bool isMouseDownOnLinkOrImage = 1064 bool isMouseDownOnLinkOrImage =
1065 event.isOverLink() || event.hitTestResult().image(); 1065 event.isOverLink() || event.hitTestResult().image();
1066 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 1066 return event.event().shiftKey() && !isMouseDownOnLinkOrImage;
1067 } 1067 }
1068 1068
1069 } // namespace blink 1069 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698