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

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

Issue 2647283006: Removing HandleVisible enum from FrameSelection (Closed)
Patch Set: Rebase 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, 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 } 684 }
685 685
686 // Adjusting base and extent will make newSelection always directional 686 // Adjusting base and extent will make newSelection always directional
687 newSelection.setIsDirectional(isDirectional); 687 newSelection.setIsDirectional(isDirectional);
688 const bool isHandleVisible = handleVisibility == HandleVisibility::Visible; 688 const bool isHandleVisible = handleVisibility == HandleVisibility::Visible;
689 if (selection().visibleSelection<EditingInFlatTreeStrategy>() == 689 if (selection().visibleSelection<EditingInFlatTreeStrategy>() ==
690 newSelection && 690 newSelection &&
691 selection().isHandleVisible() == isHandleVisible) 691 selection().isHandleVisible() == isHandleVisible)
692 return; 692 return;
693 693
694 const FrameSelection::SetSelectionOptions options = 694 selection().setSelection(
695 isHandleVisible 695 newSelection, handleVisibility,
696 ? FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | 696 FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle,
697 FrameSelection::HandleVisible 697 CursorAlignOnScroll::IfNeeded, granularity);
698 : FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle;
699
700 selection().setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded,
701 granularity);
702 } 698 }
703 699
704 void SelectionController::setCaretAtHitTestResult( 700 void SelectionController::setCaretAtHitTestResult(
705 const HitTestResult& hitTestResult) { 701 const HitTestResult& hitTestResult) {
706 Node* innerNode = hitTestResult.innerNode(); 702 Node* innerNode = hitTestResult.innerNode();
707 const VisiblePositionInFlatTree& visibleHitPos = 703 const VisiblePositionInFlatTree& visibleHitPos =
708 visiblePositionOfHitTestResult(hitTestResult); 704 visiblePositionOfHitTestResult(hitTestResult);
709 const VisiblePositionInFlatTree& visiblePos = 705 const VisiblePositionInFlatTree& visiblePos =
710 visibleHitPos.isNull() 706 visibleHitPos.isNull()
711 ? createVisiblePosition( 707 ? createVisiblePosition(
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 return event.event().altKey() && event.isOverLink(); 1070 return event.event().altKey() && event.isOverLink();
1075 } 1071 }
1076 1072
1077 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1073 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1078 bool isMouseDownOnLinkOrImage = 1074 bool isMouseDownOnLinkOrImage =
1079 event.isOverLink() || event.hitTestResult().image(); 1075 event.isOverLink() || event.hitTestResult().image();
1080 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 1076 return event.event().shiftKey() && !isMouseDownOnLinkOrImage;
1081 } 1077 }
1082 1078
1083 } // namespace blink 1079 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698