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

Unified Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2581703003: Defer focus handling to the content if it claims to have focus. (Closed)
Patch Set: Created 4 years 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/arc/notification/arc_custom_notification_view.cc
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc
index ed6d8fd42fa260403f6500742b3b34b6f6d07795..a442bef4e149713f7990383d5165d1fba7d9a27f 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -17,6 +17,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/transform.h"
#include "ui/message_center/message_center_style.h"
+#include "ui/message_center/views/custom_notification_view.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
@@ -178,6 +179,8 @@ ArcCustomNotificationView::ArcCustomNotificationView(
: item_(item),
notification_key_(item->notification_key()),
event_forwarder_(new EventForwarder(this)) {
+ SetFocusBehavior(FocusBehavior::ALWAYS);
+
item_->IncrementWindowRefCount();
item_->AddObserver(this);
@@ -442,6 +445,18 @@ void ArcCustomNotificationView::OnMouseExited(const ui::MouseEvent&) {
UpdateCloseButtonVisiblity();
}
+void ArcCustomNotificationView::OnFocus() {
+ NativeViewHost::OnFocus();
+ static_cast<message_center::CustomNotificationView*>(parent())
+ ->OnContentFocused();
+}
+
+void ArcCustomNotificationView::OnBlur() {
+ NativeViewHost::OnBlur();
+ static_cast<message_center::CustomNotificationView*>(parent())
+ ->OnContentBlured();
+}
+
void ArcCustomNotificationView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (item_ && !item_->pinned() && sender == floating_close_button_) {

Powered by Google App Engine
This is Rietveld 408576698