Introduce ConvertFromWebSelectionBoundType() to refactor
ConvertFromWebSelectionBound() Before this patch, cc_bound.type is computed using is_start and web_bound.is_text_direction_rtl. This is redundant because WebSelectionBound has .type which is computed in the same way in GetWebSelectionBound() at WebSelection.cpp. is_start and is_text_direction_rtl is exactly the same value used in both functions so we can convert kSelectionLeft to LEFT, kSelectionRight to RIGHT and kCaret to CENTER (default value). Therefore, we can introduce ConvertFromWebSelectionBoundType() which directly converts from blink::WebSelectionBound::Type to gfx::SelectionBound::Type and refactor ConvertFromWebSelectionBound() with it. This patch also renames ConvertWebSelectionBound() to ConvertFromWebSelectionBound() to clarify what type is input. See also: crrev.com/c/934106 TEST: No change in behavior. Change-Id: I3cbc4af607438841be6e2b47e10d12deaa273aa3 Reviewed-on: https://chromium-review.googlesource.com/942585Reviewed-by:Yoichi Osato <yoichio@chromium.org> Reviewed-by:
Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by:
Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:
Eric Karl <ericrk@chromium.org> Commit-Queue: Hikaru Nishida <hikarun@google.com> Cr-Commit-Position: refs/heads/master@{#543967}
Showing
Please register or sign in to comment