| Index: ui/gfx/render_text.cc
|
| diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
|
| index 7ccaaa6131a5ece76f65603b9c3cc7f5450b4248..731786461f1e37ea7cc3617bffd0f5909c8ae67f 100644
|
| --- a/ui/gfx/render_text.cc
|
| +++ b/ui/gfx/render_text.cc
|
| @@ -847,7 +847,7 @@ void RenderText::Draw(Canvas* canvas) {
|
| canvas->ClipRect(clip_rect);
|
| }
|
|
|
| - if (!text().empty() && focused())
|
| + if (!selection().is_empty())
|
| DrawSelection(canvas);
|
|
|
| if (cursor_enabled() && cursor_visible() && focused())
|
| @@ -1057,7 +1057,8 @@ RenderText::RenderText()
|
| cursor_visible_(false),
|
| cursor_color_(kDefaultColor),
|
| selection_color_(kDefaultColor),
|
| - selection_background_focused_color_(kDefaultSelectionBackgroundColor),
|
| + selection_background_color_(kDefaultSelectionBackgroundColor),
|
| + draw_text_selection_(true),
|
| focused_(false),
|
| composition_range_(Range::InvalidRange()),
|
| colors_(kDefaultColor),
|
| @@ -1630,8 +1631,10 @@ void RenderText::UpdateCachedBoundsAndOffset() {
|
| }
|
|
|
| void RenderText::DrawSelection(Canvas* canvas) {
|
| + if (!draw_text_selection_)
|
| + return;
|
| for (const Rect& s : GetSubstringBounds(selection()))
|
| - canvas->FillRect(s, selection_background_focused_color_);
|
| + canvas->FillRect(s, selection_background_color_);
|
| }
|
|
|
| size_t RenderText::GetNearestWordStartBoundary(size_t index) const {
|
|
|