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

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

Issue 273173003: Notifications: Retain button hover state during content updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/message_center/views/notification_button.cc
diff --git a/ui/message_center/views/notification_button.cc b/ui/message_center/views/notification_button.cc
index 3cc0fecf037a6015c1b181a45f37097d1548f451..77c359c23a00cb5398ef87345996e0f48b48e1e0 100644
--- a/ui/message_center/views/notification_button.cc
+++ b/ui/message_center/views/notification_button.cc
@@ -98,6 +98,14 @@ void NotificationButton::OnBlur() {
SchedulePaint();
}
+void NotificationButton::ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) {
+ // We disable view hierarchy change detection in the parent
+ // because it resets the hoverstate, which we do not want
+ // when we update the view to contain a new label or image.
+ views::View::ViewHierarchyChanged(details);
+}
+
void NotificationButton::StateChanged() {
if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
set_background(views::Background::CreateSolidBackground(

Powered by Google App Engine
This is Rietveld 408576698