| 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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 kFocusBorderColor, gfx::Insets(0, 1, 3, 2)); | 77 kFocusBorderColor, gfx::Insets(0, 1, 3, 2)); |
| 78 | 78 |
| 79 UpdateWithNotification(notification); | 79 UpdateWithNotification(notification); |
| 80 } | 80 } |
| 81 | 81 |
| 82 MessageView::~MessageView() { | 82 MessageView::~MessageView() { |
| 83 } | 83 } |
| 84 | 84 |
| 85 void MessageView::UpdateWithNotification(const Notification& notification) { | 85 void MessageView::UpdateWithNotification(const Notification& notification) { |
| 86 display_source_ = notification.display_source(); | 86 display_source_ = notification.display_source(); |
| 87 pinned_ = notification.pinned(); |
| 87 accessible_name_ = CreateAccessibleName(notification); | 88 accessible_name_ = CreateAccessibleName(notification); |
| 88 set_slide_out_enabled(!notification.pinned()); | 89 set_slide_out_enabled(!notification.pinned()); |
| 89 } | 90 } |
| 90 | 91 |
| 91 // static | 92 // static |
| 92 gfx::Insets MessageView::GetShadowInsets() { | 93 gfx::Insets MessageView::GetShadowInsets() { |
| 93 return -gfx::ShadowValue::GetMargin( | 94 return -gfx::ShadowValue::GetMargin( |
| 94 gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius).values); | 95 gfx::ShadowDetails::Get(kShadowElevation, kShadowCornerRadius).values); |
| 95 } | 96 } |
| 96 | 97 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 222 } |
| 222 | 223 |
| 223 void MessageView::SetDrawBackgroundAsActive(bool active) { | 224 void MessageView::SetDrawBackgroundAsActive(bool active) { |
| 224 background_view_->background()-> | 225 background_view_->background()-> |
| 225 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : | 226 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : |
| 226 kNotificationBackgroundColor); | 227 kNotificationBackgroundColor); |
| 227 SchedulePaint(); | 228 SchedulePaint(); |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace message_center | 231 } // namespace message_center |
| OLD | NEW |