OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_view.h" | 5 #include "ui/message_center/views/message_view.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const NotifierId& notifier_id, | 168 const NotifierId& notifier_id, |
169 const string16& display_source) | 169 const string16& display_source) |
170 : controller_(controller), | 170 : controller_(controller), |
171 notification_id_(notification_id), | 171 notification_id_(notification_id), |
172 notifier_id_(notifier_id), | 172 notifier_id_(notifier_id), |
173 context_menu_controller_( | 173 context_menu_controller_( |
174 new MessageViewContextMenuController(controller, | 174 new MessageViewContextMenuController(controller, |
175 notifier_id, | 175 notifier_id, |
176 display_source)), | 176 display_source)), |
177 scroller_(NULL) { | 177 scroller_(NULL) { |
178 set_focusable(true); | 178 SetFocusable(true); |
179 set_context_menu_controller(context_menu_controller_.get()); | 179 set_context_menu_controller(context_menu_controller_.get()); |
180 | 180 |
181 PaddedButton *close = new PaddedButton(this); | 181 PaddedButton *close = new PaddedButton(this); |
182 close->SetPadding(-kCloseIconRightPadding, kCloseIconTopPadding); | 182 close->SetPadding(-kCloseIconRightPadding, kCloseIconTopPadding); |
183 close->SetNormalImage(IDR_NOTIFICATION_CLOSE); | 183 close->SetNormalImage(IDR_NOTIFICATION_CLOSE); |
184 close->SetHoveredImage(IDR_NOTIFICATION_CLOSE_HOVER); | 184 close->SetHoveredImage(IDR_NOTIFICATION_CLOSE_HOVER); |
185 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED); | 185 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED); |
186 close->set_owned_by_client(); | 186 close->set_owned_by_client(); |
187 close->set_animate_on_state_change(false); | 187 close->set_animate_on_state_change(false); |
188 close->SetAccessibleName(l10n_util::GetStringUTF16( | 188 close->SetAccessibleName(l10n_util::GetStringUTF16( |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (sender == close_button()) { | 302 if (sender == close_button()) { |
303 controller_->RemoveNotification(notification_id_, true); // By user. | 303 controller_->RemoveNotification(notification_id_, true); // By user. |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 void MessageView::OnSlideOut() { | 307 void MessageView::OnSlideOut() { |
308 controller_->RemoveNotification(notification_id_, true); // By user. | 308 controller_->RemoveNotification(notification_id_, true); // By user. |
309 } | 309 } |
310 | 310 |
311 } // namespace message_center | 311 } // namespace message_center |
OLD | NEW |