| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 SetDrawBackgroundAsActive(false); | 199 SetDrawBackgroundAsActive(false); |
| 200 controller_->ClickOnNotification(notification_id_); | 200 controller_->ClickOnNotification(notification_id_); |
| 201 event->SetHandled(); | 201 event->SetHandled(); |
| 202 return; | 202 return; |
| 203 } | 203 } |
| 204 default: { | 204 default: { |
| 205 // Do nothing | 205 // Do nothing |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 slide_out_controller_.OnGestureEvent(event); |
| 210 // Do not return here by checking handled(). SlideOutController calls |
| 211 // SetHandled() even though the scroll gesture doesn't make no (or little) |
| 212 // effects on the slide-out behavior. See http://crbug.com/172991 |
| 213 |
| 209 if (!event->IsScrollGestureEvent() && !event->IsFlingScrollEvent()) | 214 if (!event->IsScrollGestureEvent() && !event->IsFlingScrollEvent()) |
| 210 return; | 215 return; |
| 211 | 216 |
| 212 if (scroller_) | 217 if (scroller_) |
| 213 scroller_->OnGestureEvent(event); | 218 scroller_->OnGestureEvent(event); |
| 214 event->SetHandled(); | 219 event->SetHandled(); |
| 215 } | 220 } |
| 216 | 221 |
| 217 ui::Layer* MessageView::GetSlideOutLayer() { | 222 ui::Layer* MessageView::GetSlideOutLayer() { |
| 218 return is_nested_ ? layer() : GetWidget()->GetLayer(); | 223 return is_nested_ ? layer() : GetWidget()->GetLayer(); |
| 219 } | 224 } |
| 220 | 225 |
| 221 void MessageView::OnSlideOut() { | 226 void MessageView::OnSlideOut() { |
| 222 controller_->RemoveNotification(notification_id_, true); // By user. | 227 controller_->RemoveNotification(notification_id_, true); // By user. |
| 223 } | 228 } |
| 224 | 229 |
| 225 void MessageView::OnCloseButtonPressed() { | 230 void MessageView::OnCloseButtonPressed() { |
| 226 controller_->RemoveNotification(notification_id_, true); // By user. | 231 controller_->RemoveNotification(notification_id_, true); // By user. |
| 227 } | 232 } |
| 228 | 233 |
| 229 void MessageView::SetDrawBackgroundAsActive(bool active) { | 234 void MessageView::SetDrawBackgroundAsActive(bool active) { |
| 230 background_view_->background()-> | 235 background_view_->background()-> |
| 231 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : | 236 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : |
| 232 kNotificationBackgroundColor); | 237 kNotificationBackgroundColor); |
| 233 SchedulePaint(); | 238 SchedulePaint(); |
| 234 } | 239 } |
| 235 | 240 |
| 236 } // namespace message_center | 241 } // namespace message_center |
| OLD | NEW |