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

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

Issue 2929803002: Make close button visible when focusing inline actions.
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/message_center/views/notification_view.h ('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 f65b597fa179a0609ae16f47e6329e25f75ce73b..da0e9a2239a2fc600277c98ad93daa59ec8ea6ea 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -708,10 +708,7 @@ void NotificationView::CreateOrUpdateCloseButtonView(
}
void NotificationView::UpdateControlButtonsVisibility() {
- const bool target_visibility =
- IsMouseHovered() || HasFocus() ||
- (close_button_ && close_button_->HasFocus()) ||
- (settings_button_view_ && settings_button_view_->HasFocus());
+ const bool target_visibility = IsMouseHovered() || HasFocusedView();
if (close_button_) {
if (target_visibility != close_button_->visible())
@@ -765,4 +762,9 @@ int NotificationView::GetMessageHeight(int width, int limit) const {
message_view_->GetSizeForWidthAndLines(width, limit).height() : 0;
}
+bool NotificationView::HasFocusedView() {
+ const views::FocusManager* focus_manager = GetFocusManager();
+ return focus_manager && Contains(focus_manager->GetFocusedView());
+}
+
} // namespace message_center
« no previous file with comments | « ui/message_center/views/notification_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698