| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // static | 77 // static |
| 78 gfx::Insets MessageView::GetShadowInsets() { | 78 gfx::Insets MessageView::GetShadowInsets() { |
| 79 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, | 79 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, |
| 80 kShadowBlur / 2, | 80 kShadowBlur / 2, |
| 81 kShadowBlur / 2 + kShadowOffset, | 81 kShadowBlur / 2 + kShadowOffset, |
| 82 kShadowBlur / 2); | 82 kShadowBlur / 2); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void MessageView::CreateShadowBorder() { | 85 void MessageView::CreateShadowBorder() { |
| 86 set_border(new views::ShadowBorder(kShadowBlur, | 86 SetBorder(scoped_ptr<views::Border>( |
| 87 message_center::kShadowColor, | 87 new views::ShadowBorder(kShadowBlur, |
| 88 kShadowOffset, // Vertical offset. | 88 message_center::kShadowColor, |
| 89 0)); // Horizontal offset. | 89 kShadowOffset, // Vertical offset. |
| 90 0))); // Horizontal offset. |
| 90 } | 91 } |
| 91 | 92 |
| 92 bool MessageView::IsCloseButtonFocused() { | 93 bool MessageView::IsCloseButtonFocused() { |
| 93 views::FocusManager* focus_manager = GetFocusManager(); | 94 views::FocusManager* focus_manager = GetFocusManager(); |
| 94 return focus_manager && focus_manager->GetFocusedView() == close_button(); | 95 return focus_manager && focus_manager->GetFocusedView() == close_button(); |
| 95 } | 96 } |
| 96 | 97 |
| 97 void MessageView::RequestFocusOnCloseButton() { | 98 void MessageView::RequestFocusOnCloseButton() { |
| 98 close_button_->RequestFocus(); | 99 close_button_->RequestFocus(); |
| 99 } | 100 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (sender == close_button()) { | 193 if (sender == close_button()) { |
| 193 controller_->RemoveNotification(notification_id_, true); // By user. | 194 controller_->RemoveNotification(notification_id_, true); // By user. |
| 194 } | 195 } |
| 195 } | 196 } |
| 196 | 197 |
| 197 void MessageView::OnSlideOut() { | 198 void MessageView::OnSlideOut() { |
| 198 controller_->RemoveNotification(notification_id_, true); // By user. | 199 controller_->RemoveNotification(notification_id_, true); // By user. |
| 199 } | 200 } |
| 200 | 201 |
| 201 } // namespace message_center | 202 } // namespace message_center |
| OLD | NEW |