| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 message_center_->ClickOnNotification(notification_id_); | 423 message_center_->ClickOnNotification(notification_id_); |
| 424 event->SetHandled(); | 424 event->SetHandled(); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 SlideOutView::OnGestureEvent(event); | 428 SlideOutView::OnGestureEvent(event); |
| 429 // Do not return here by checking handled(). SlideOutView calls SetHandled() | 429 // Do not return here by checking handled(). SlideOutView calls SetHandled() |
| 430 // even though the scroll gesture doesn't make no (or little) effects on the | 430 // even though the scroll gesture doesn't make no (or little) effects on the |
| 431 // slide-out behavior. See http://crbug.com/172991 | 431 // slide-out behavior. See http://crbug.com/172991 |
| 432 | 432 |
| 433 if (!event->IsScrollGestureEvent()) | 433 if (!event->IsScrollGestureEvent() && !event->IsFlingScrollEvent()) |
| 434 return; | 434 return; |
| 435 | 435 |
| 436 if (scroller_) | 436 if (scroller_) |
| 437 scroller_->OnGestureEvent(event); | 437 scroller_->OnGestureEvent(event); |
| 438 event->SetHandled(); | 438 event->SetHandled(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 void MessageView::OnPaintFocusBorder(gfx::Canvas* canvas) { | 441 void MessageView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| 442 if (HasFocus()) { | 442 if (HasFocus()) { |
| 443 canvas->DrawRect(gfx::Rect(1, 0, width() - 2, height() - 2), | 443 canvas->DrawRect(gfx::Rect(1, 0, width() - 2, height() - 2), |
| 444 message_center::kFocusBorderColor); | 444 message_center::kFocusBorderColor); |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 void MessageView::ButtonPressed(views::Button* sender, | 448 void MessageView::ButtonPressed(views::Button* sender, |
| 449 const ui::Event& event) { | 449 const ui::Event& event) { |
| 450 if (sender == close_button()) { | 450 if (sender == close_button()) { |
| 451 message_center_->RemoveNotification(notification_id_, true); // By user. | 451 message_center_->RemoveNotification(notification_id_, true); // By user. |
| 452 } else if (sender == expand_button()) { | 452 } else if (sender == expand_button()) { |
| 453 is_expanded_ = true; | 453 is_expanded_ = true; |
| 454 message_center_->ExpandNotification(notification_id_); | 454 message_center_->ExpandNotification(notification_id_); |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 | 457 |
| 458 void MessageView::OnSlideOut() { | 458 void MessageView::OnSlideOut() { |
| 459 message_center_->RemoveNotification(notification_id_, true); // By user. | 459 message_center_->RemoveNotification(notification_id_, true); // By user. |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace message_center | 462 } // namespace message_center |
| OLD | NEW |