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 10 matching lines...) Expand all Loading... |
21 icon_(NULL), | 21 icon_(NULL), |
22 title_(NULL), | 22 title_(NULL), |
23 focus_painter_(views::Painter::CreateSolidFocusPainter( | 23 focus_painter_(views::Painter::CreateSolidFocusPainter( |
24 message_center::kFocusBorderColor, | 24 message_center::kFocusBorderColor, |
25 gfx::Insets(1, 2, 2, 2))) { | 25 gfx::Insets(1, 2, 2, 2))) { |
26 Button::ConfigureDefaultFocus(this); | 26 Button::ConfigureDefaultFocus(this); |
27 // Create a background so that it does not change when the MessageView | 27 // Create a background so that it does not change when the MessageView |
28 // background changes to show touch feedback | 28 // background changes to show touch feedback |
29 set_background(views::Background::CreateSolidBackground( | 29 set_background(views::Background::CreateSolidBackground( |
30 kNotificationBackgroundColor)); | 30 kNotificationBackgroundColor)); |
31 set_request_focus_on_press(false); | |
32 set_notify_enter_exit_on_child(true); | 31 set_notify_enter_exit_on_child(true); |
33 SetLayoutManager( | 32 SetLayoutManager( |
34 new views::BoxLayout(views::BoxLayout::kHorizontal, | 33 new views::BoxLayout(views::BoxLayout::kHorizontal, |
35 message_center::kButtonHorizontalPadding, | 34 message_center::kButtonHorizontalPadding, |
36 kButtonVecticalPadding, | 35 kButtonVecticalPadding, |
37 message_center::kButtonIconToTitlePadding)); | 36 message_center::kButtonIconToTitlePadding)); |
38 } | 37 } |
39 | 38 |
40 NotificationButton::~NotificationButton() { | 39 NotificationButton::~NotificationButton() { |
41 } | 40 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { | 113 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { |
115 set_background(views::Background::CreateSolidBackground( | 114 set_background(views::Background::CreateSolidBackground( |
116 message_center::kHoveredButtonBackgroundColor)); | 115 message_center::kHoveredButtonBackgroundColor)); |
117 } else { | 116 } else { |
118 set_background(views::Background::CreateSolidBackground( | 117 set_background(views::Background::CreateSolidBackground( |
119 kNotificationBackgroundColor)); | 118 kNotificationBackgroundColor)); |
120 } | 119 } |
121 } | 120 } |
122 | 121 |
123 } // namespace message_center | 122 } // namespace message_center |
OLD | NEW |