| 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 966fe19f86c68c0db88b1ae5bba6ac19b11c65f1..da750d916c7b5ceeacb44af979ed7e7f554a544f 100644
|
| --- a/ui/message_center/views/notification_view.cc
|
| +++ b/ui/message_center/views/notification_view.cc
|
| @@ -345,6 +345,16 @@ gfx::NativeCursor NotificationView::GetCursor(const ui::MouseEvent& event) {
|
| return views::GetNativeHandCursor();
|
| }
|
|
|
| +void NotificationView::OnMouseEntered(const ui::MouseEvent& event) {
|
| + MessageView::OnMouseEntered(event);
|
| + UpdateControlButtonsVisibility();
|
| +}
|
| +
|
| +void NotificationView::OnMouseExited(const ui::MouseEvent& event) {
|
| + MessageView::OnMouseExited(event);
|
| + UpdateControlButtonsVisibility();
|
| +}
|
| +
|
| void NotificationView::UpdateWithNotification(
|
| const Notification& notification) {
|
| MessageView::UpdateWithNotification(notification);
|
| @@ -525,6 +535,7 @@ void NotificationView::CreateOrUpdateSettingsButtonView(
|
| settings_button_view_ = settings;
|
| AddChildView(settings_button_view_);
|
| }
|
| + UpdateControlButtonsVisibility();
|
| }
|
|
|
| void NotificationView::CreateOrUpdateProgressBarView(
|
| @@ -689,11 +700,29 @@ void NotificationView::CreateOrUpdateCloseButtonView(
|
| IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_TOOLTIP));
|
| close_button_->set_owned_by_client();
|
| AddChildView(close_button_.get());
|
| + UpdateControlButtonsVisibility();
|
| } else if (notification.pinned() && close_button_) {
|
| close_button_.reset();
|
| }
|
| }
|
|
|
| +void NotificationView::UpdateControlButtonsVisibility() {
|
| + const bool target_visibility =
|
| + IsMouseHovered() || HasFocus() ||
|
| + (close_button_ && close_button_->HasFocus()) ||
|
| + (settings_button_view_ && settings_button_view_->HasFocus());
|
| +
|
| + if (close_button_) {
|
| + if (target_visibility != close_button_->visible())
|
| + close_button_->SetVisible(target_visibility);
|
| + }
|
| +
|
| + if (settings_button_view_) {
|
| + if (target_visibility != settings_button_view_->visible())
|
| + settings_button_view_->SetVisible(target_visibility);
|
| + }
|
| +}
|
| +
|
| int NotificationView::GetMessageLineLimit(int title_lines, int width) const {
|
| // Image notifications require that the image must be kept flush against
|
| // their icons, but we can allow more text if no image.
|
|
|