Commit 580f31e2 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Paint MessageView focus ring on top of children.

Focus ring around MessageView should be painted on top of all the
children.

TEST=manual
BUG=887366

Change-Id: I5667aff33196a5f3f8792b4e936e7da1cdda1057
Reviewed-on: https://chromium-review.googlesource.com/1255750Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595843}
parent e0f8cd94
......@@ -11,6 +11,7 @@
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
......@@ -241,6 +242,15 @@ bool MessageView::OnKeyReleased(const ui::KeyEvent& event) {
return true;
}
void MessageView::PaintChildren(const views::PaintInfo& paint_info) {
views::View::PaintChildren(paint_info);
// Paint focus ring on top of all the children.
ui::PaintRecorder recorder(paint_info.context(), size());
views::Painter::PaintFocusPainter(this, recorder.canvas(),
focus_painter_.get());
}
void MessageView::OnPaint(gfx::Canvas* canvas) {
if (ShouldShowAeroShadowBorder()) {
// If the border is shadow, paint border first.
......@@ -249,7 +259,6 @@ void MessageView::OnPaint(gfx::Canvas* canvas) {
} else {
views::View::OnPaint(canvas);
}
views::Painter::PaintFocusPainter(this, canvas, focus_painter_.get());
}
void MessageView::OnFocus() {
......
......@@ -111,6 +111,7 @@ class MESSAGE_CENTER_EXPORT MessageView : public views::InkDropHostView,
void OnMouseReleased(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
bool OnKeyReleased(const ui::KeyEvent& event) override;
void PaintChildren(const views::PaintInfo& paint_info) override;
void OnPaint(gfx::Canvas* canvas) override;
void OnFocus() override;
void OnBlur() override;
......
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