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

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: 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/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 813917cafbd72708551010f2dcfbf7c57b66facd..55e8afd16ed8bf5409d189f46c519a17e0f12bd2 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -18,6 +18,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"
@@ -179,6 +180,8 @@ ArcCustomNotificationView::ArcCustomNotificationView(
: item_(item),
notification_key_(item->notification_key()),
event_forwarder_(new EventForwarder(this)) {
+ SetFocusBehavior(FocusBehavior::ALWAYS);
+
item_->IncrementWindowRefCount();
item_->AddObserver(this);
@@ -443,6 +446,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_) {
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698