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

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

Issue 2726773003: Reland: Make popup notification active on being clicked (Closed)
Patch Set: Relanded Patch Created 3 years, 10 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
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/message_center/views/toast_contents_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b622f420755237ce93700d03a26ce68e2073049f..1d150cbcfdac6a0d0553397a11ec49627c5ed108 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -21,6 +21,7 @@
#include "ui/message_center/message_center_style.h"
#include "ui/message_center/views/custom_notification_view.h"
#include "ui/message_center/views/padded_button.h"
+#include "ui/message_center/views/toast_contents_view.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
@@ -56,6 +57,11 @@ class ArcCustomNotificationView::EventForwarder : public ui::EventHandler {
} else if (event->IsMouseWheelEvent()) {
ForwardMouseWheelEvent(event->AsMouseWheelEvent());
} else if (!event->IsTouchEvent()) {
+ // TODO(yoshiki): Use a better tigger (eg. focusing EditText on
+ // notification) than clicking (crbug.com/697379).
+ if (event->type() == ui::ET_MOUSE_PRESSED)
+ owner_->ActivateToast();
+
// Forward the rest events to |owner_| except touches because View
// should no longer receive touch events. See View::OnTouchEvent.
owner_->OnEvent(event);
@@ -497,6 +503,14 @@ void ArcCustomNotificationView::OnBlur() {
->OnContentBlured();
}
+void ArcCustomNotificationView::ActivateToast() {
+ if (message_center::ToastContentsView::kViewClassName ==
+ parent()->parent()->GetClassName()) {
+ static_cast<message_center::ToastContentsView*>(parent()->parent())
+ ->ActivateToast();
+ }
+}
+
views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() {
if (floating_control_buttons_widget_)
return static_cast<views::internal::RootView*>(
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/message_center/views/toast_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698