Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: ui/message_center/views/custom_notification_view.h

Issue 2581703003: Defer focus handling to the content if it claims to have focus. (Closed)
Patch Set: address the comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/message_center/views/custom_notification_view.h
diff --git a/ui/message_center/views/custom_notification_view.h b/ui/message_center/views/custom_notification_view.h
index 6a7a2a2d43f2e06bde516a3fb79bd4c18f9c6749..ff9d2a7240f5a8f29dfd6b950d1ce14d9adb9edb 100644
--- a/ui/message_center/views/custom_notification_view.h
+++ b/ui/message_center/views/custom_notification_view.h
@@ -9,6 +9,10 @@
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/views/message_view.h"
+namespace views {
+class Painter;
+}
+
namespace message_center {
// View for notification with NOTIFICATION_TYPE_CUSTOM that hosts the custom
@@ -19,6 +23,11 @@ class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView {
const Notification& notification);
~CustomNotificationView() override;
+ // These method are called by the content view when focus handling is defered
+ // to the content.
+ void OnContentFocused();
+ void OnContentBlured();
+
// Overidden from MessageView:
void SetDrawBackgroundAsActive(bool active) override;
bool IsCloseButtonFocused() const override;
@@ -28,6 +37,9 @@ class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView {
// Overridden from views::View:
gfx::Size GetPreferredSize() const override;
void Layout() override;
+ bool HasFocus() const override;
+ void RequestFocus() override;
+ void OnPaint(gfx::Canvas* canvas) override;
private:
friend class CustomNotificationViewTest;
@@ -37,6 +49,8 @@ class MESSAGE_CENTER_EXPORT CustomNotificationView : public MessageView {
std::unique_ptr<CustomNotificationContentViewDelegate>
contents_view_delegate_;
+ std::unique_ptr<views::Painter> focus_painter_;
+
DISALLOW_COPY_AND_ASSIGN(CustomNotificationView);
};
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.cc ('k') | ui/message_center/views/custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698