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

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: Move to STLDeleteElements. 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
« no previous file with comments | « ui/message_center/views/notification_button.h ('k') | ui/message_center/views/notification_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa38633ced5f583be2c588ce4d50ccacb16415a3..75219e8d3dc6e7a47be18e9e55160b139d725225 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(
« no previous file with comments | « ui/message_center/views/notification_button.h ('k') | ui/message_center/views/notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698