Commit f5e1c998 authored by Hikaru Nishida's avatar Hikaru Nishida Committed by Commit Bot

Improve maintainability and add default constructor of WebSelectionBound

Before this patch, default values of members in WebSelectionBound are
specified in constructor initialization list.
To improve maintainability, this patch adds default values to
each member definitions.
This patch also adds default constructor of WebSelectionBound to improve
readability of the patch crrev.com/c/908169 .

TEST: No change in behavior.
Change-Id: I54c7910aba6ce9fe1dd4c881c7b944da52cf5ec0
Reviewed-on: https://chromium-review.googlesource.com/920048
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537235}
parent 7db16184
...@@ -16,15 +16,18 @@ struct WebSelectionBound { ...@@ -16,15 +16,18 @@ struct WebSelectionBound {
// |WebSelection| for determining bound orientation. // |WebSelection| for determining bound orientation.
enum Type { kCaret, kSelectionLeft, kSelectionRight }; enum Type { kCaret, kSelectionLeft, kSelectionRight };
explicit WebSelectionBound(Type type) #if INSIDE_BLINK
: type(type), layer_id(0), is_text_direction_rtl(false), hidden(false) {} WebSelectionBound() = default;
#endif
explicit WebSelectionBound(Type type) : type(type) {}
// The logical type of the endpoint. Note that this is dependent not only on // The logical type of the endpoint. Note that this is dependent not only on
// the bound's relative location, but also the underlying text direction. // the bound's relative location, but also the underlying text direction.
Type type; Type type = kCaret;
// The id of the platform layer to which the bound should be anchored. // The id of the platform layer to which the bound should be anchored.
int layer_id; int layer_id = 0;
// The bottom and top coordinates of the edge (caret), in layer coordinates, // The bottom and top coordinates of the edge (caret), in layer coordinates,
// that define the selection bound. // that define the selection bound.
...@@ -32,10 +35,10 @@ struct WebSelectionBound { ...@@ -32,10 +35,10 @@ struct WebSelectionBound {
WebPoint edge_bottom_in_layer; WebPoint edge_bottom_in_layer;
// Whether the text direction at this location is RTL. // Whether the text direction at this location is RTL.
bool is_text_direction_rtl; bool is_text_direction_rtl = false;
// Whether this bound is hidden (clipped out/occluded). // Whether this bound is hidden (clipped out/occluded).
bool hidden; bool hidden = false;
}; };
} // namespace blink } // namespace blink
......
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