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

Side by Side Diff: ui/message_center/views/notification_button.cc

Issue 2680643002: Add old_state parameter to CustomButton::StateChanged (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/message_center/views/notification_button.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_button.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698