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 "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/base/models/simple_menu_model.h" | 9 #include "ui/base/models/simple_menu_model.h" |
10 #include "ui/base/ui_base_switches_util.h" | 10 #include "ui/base/ui_base_switches_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED); | 70 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED); |
71 close->set_animate_on_state_change(false); | 71 close->set_animate_on_state_change(false); |
72 close->SetAccessibleName(l10n_util::GetStringUTF16( | 72 close->SetAccessibleName(l10n_util::GetStringUTF16( |
73 IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME)); | 73 IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME)); |
74 // The close button should be added to view hierarchy by the derived class. | 74 // The close button should be added to view hierarchy by the derived class. |
75 // This ensures that it is on top of other views. | 75 // This ensures that it is on top of other views. |
76 close->set_owned_by_client(); | 76 close->set_owned_by_client(); |
77 close_button_.reset(close); | 77 close_button_.reset(close); |
78 | 78 |
79 focus_painter_ = views::Painter::CreateSolidFocusPainter( | 79 focus_painter_ = views::Painter::CreateSolidFocusPainter( |
80 kFocusBorderColor, | 80 kFocusBorderColor, gfx::Insets(0, 1, 3, 2)); |
81 gfx::Insets(0, 1, 3, 2)).Pass(); | |
82 } | 81 } |
83 | 82 |
84 MessageView::~MessageView() { | 83 MessageView::~MessageView() { |
85 } | 84 } |
86 | 85 |
87 void MessageView::UpdateWithNotification(const Notification& notification) { | 86 void MessageView::UpdateWithNotification(const Notification& notification) { |
88 small_image_view_->SetImage(notification.small_image().AsImageSkia()); | 87 small_image_view_->SetImage(notification.small_image().AsImageSkia()); |
89 display_source_ = notification.display_source(); | 88 display_source_ = notification.display_source(); |
90 } | 89 } |
91 | 90 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 void MessageView::SetDrawBackgroundAsActive(bool active) { | 241 void MessageView::SetDrawBackgroundAsActive(bool active) { |
243 if (!switches::IsTouchFeedbackEnabled()) | 242 if (!switches::IsTouchFeedbackEnabled()) |
244 return; | 243 return; |
245 background_view_->background()-> | 244 background_view_->background()-> |
246 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : | 245 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : |
247 kNotificationBackgroundColor); | 246 kNotificationBackgroundColor); |
248 SchedulePaint(); | 247 SchedulePaint(); |
249 } | 248 } |
250 | 249 |
251 } // namespace message_center | 250 } // namespace message_center |
OLD | NEW |