| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/message_center/views/notification_button.h" | 5 #include "ui/message_center/views/notification_button.h" |
| 6 | 6 |
| 7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
| 8 #include "ui/message_center/message_center_style.h" | 8 #include "ui/message_center/message_center_style.h" |
| 9 #include "ui/message_center/views/constants.h" | 9 #include "ui/message_center/views/constants.h" |
| 10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 | 103 |
| 104 void NotificationButton::ViewHierarchyChanged( | 104 void NotificationButton::ViewHierarchyChanged( |
| 105 const ViewHierarchyChangedDetails& details) { | 105 const ViewHierarchyChangedDetails& details) { |
| 106 // We disable view hierarchy change detection in the parent | 106 // We disable view hierarchy change detection in the parent |
| 107 // because it resets the hoverstate, which we do not want | 107 // because it resets the hoverstate, which we do not want |
| 108 // when we update the view to contain a new label or image. | 108 // when we update the view to contain a new label or image. |
| 109 views::View::ViewHierarchyChanged(details); | 109 views::View::ViewHierarchyChanged(details); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void NotificationButton::StateChanged() { | 112 void NotificationButton::StateChanged(ButtonState old_state) { |
| 113 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { | 113 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { |
| 114 set_background(views::Background::CreateSolidBackground( | 114 set_background(views::Background::CreateSolidBackground( |
| 115 message_center::kHoveredButtonBackgroundColor)); | 115 message_center::kHoveredButtonBackgroundColor)); |
| 116 } else { | 116 } else { |
| 117 set_background(views::Background::CreateSolidBackground( | 117 set_background(views::Background::CreateSolidBackground( |
| 118 kNotificationBackgroundColor)); | 118 kNotificationBackgroundColor)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace message_center | 122 } // namespace message_center |
| OLD | NEW |