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 26 matching lines...) Expand all Loading... |
37 const std::string& notification_id, | 37 const std::string& notification_id, |
38 const NotifierId& notifier_id, | 38 const NotifierId& notifier_id, |
39 const gfx::ImageSkia& small_image, | 39 const gfx::ImageSkia& small_image, |
40 const base::string16& display_source) | 40 const base::string16& display_source) |
41 : controller_(controller), | 41 : controller_(controller), |
42 notification_id_(notification_id), | 42 notification_id_(notification_id), |
43 notifier_id_(notifier_id), | 43 notifier_id_(notifier_id), |
44 background_view_(NULL), | 44 background_view_(NULL), |
45 scroller_(NULL), | 45 scroller_(NULL), |
46 display_source_(display_source) { | 46 display_source_(display_source) { |
47 SetFocusable(true); | 47 SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
48 | 48 |
49 // Create the opaque background that's above the view's shadow. | 49 // Create the opaque background that's above the view's shadow. |
50 background_view_ = new views::View(); | 50 background_view_ = new views::View(); |
51 background_view_->set_background( | 51 background_view_->set_background( |
52 views::Background::CreateSolidBackground(kNotificationBackgroundColor)); | 52 views::Background::CreateSolidBackground(kNotificationBackgroundColor)); |
53 AddChildView(background_view_); | 53 AddChildView(background_view_); |
54 | 54 |
55 views::ImageView* small_image_view = new views::ImageView(); | 55 views::ImageView* small_image_view = new views::ImageView(); |
56 small_image_view->SetImage(small_image); | 56 small_image_view->SetImage(small_image); |
57 small_image_view->SetImageSize(gfx::Size(kSmallImageSize, kSmallImageSize)); | 57 small_image_view->SetImageSize(gfx::Size(kSmallImageSize, kSmallImageSize)); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void MessageView::SetDrawBackgroundAsActive(bool active) { | 217 void MessageView::SetDrawBackgroundAsActive(bool active) { |
218 if (!switches::IsTouchFeedbackEnabled()) | 218 if (!switches::IsTouchFeedbackEnabled()) |
219 return; | 219 return; |
220 background_view_->background()-> | 220 background_view_->background()-> |
221 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : | 221 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : |
222 kNotificationBackgroundColor); | 222 kNotificationBackgroundColor); |
223 SchedulePaint(); | 223 SchedulePaint(); |
224 } | 224 } |
225 | 225 |
226 } // namespace message_center | 226 } // namespace message_center |
OLD | NEW |