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

Unified Diff: ui/message_center/views/notification_view.cc

Issue 2954373002: Make the control buttons on a notification always show on non Chrome OS platform. (Closed)
Patch Set: Created 3 years, 6 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view.cc
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index 5fdf772b2fff8949413fc04d191654f608027fd1..d4c55effee675c7f590380c0b26579f116a8e1f9 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -216,6 +216,7 @@ NotificationView::NotificationView(MessageCenterController* controller,
SetEventTargeter(
std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
+ set_notify_enter_exit_on_child(true);
}
NotificationView::~NotificationView() {
@@ -709,10 +710,20 @@ void NotificationView::CreateOrUpdateCloseButtonView(
}
void NotificationView::UpdateControlButtonsVisibility() {
+#if defined(OS_CHROMEOS)
+ // On Chrome OS, the settings button and the close button are shown only when
+ // the mouse is hovering on the notification.
const bool target_visibility =
IsMouseHovered() || HasFocus() ||
- (close_button_ && close_button_->HasFocus()) ||
- (settings_button_view_ && settings_button_view_->HasFocus());
+ (close_button_ &&
+ (close_button_->HasFocus() || close_button_->IsMouseHovered())) ||
+ (settings_button_view_ && (settings_button_view_->HasFocus() ||
+ settings_button_view_->IsMouseHovered()));
+#else
+ // On non Chrome OS, the settings button and the close button are always
+ // shown.
+ const bool target_visibility = true;
+#endif
if (close_button_) {
if (target_visibility != close_button_->visible())
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698