Commit 9063cb91 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Get rid of redundant call of SetIsDirectional() in...

Get rid of redundant call of SetIsDirectional() in SelectionController::SetNonDirectionalSelectionIfNeeded()

This patch gets rid of redundant call of |SetIsDirectional()| in
|SelectionController::SetNonDirectionalSelectionIfNeeded()|, because
 - We want to set non-directional selection as function name suggested
 - In |FrameSelection::SetSelection()|, we always set directional selection if
   |ShouldConsiderSelectionAsDirectional()| is true.

Bug: 740804
Change-Id: Ia474742aee16d13e124c41f4d7830614c35bd2f2
Reviewed-on: https://chromium-review.googlesource.com/595427Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491618}
parent df743f35
......@@ -806,11 +806,7 @@ void SelectionController::SetNonDirectionalSelectionIfNeeded(
original_base_in_flat_tree_ = PositionInFlatTreeWithAffinity();
}
builder.SetIsHandleVisible(handle_visibility == HandleVisibility::kVisible)
.SetIsDirectional(frame_->GetEditor()
.Behavior()
.ShouldConsiderSelectionAsDirectional() ||
new_selection.IsDirectional());
builder.SetIsHandleVisible(handle_visibility == HandleVisibility::kVisible);
const SelectionInFlatTree& selection_in_flat_tree = builder.Build();
if (Selection().ComputeVisibleSelectionInFlatTree() ==
CreateVisibleSelection(selection_in_flat_tree) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment