Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: ui/message_center/views/message_view.cc

Issue 19471016: message-center: Fix fling scroll in the list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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() &&
434 event->type() != ui::ET_SCROLL_FLING_START)
Jun Mukai 2013/07/24 00:52:08 by the way, should it also check ET_SCROLL_FLING_C
sadrul 2013/07/24 04:46:43 Done. (The gesture-recognizer never generates a F
434 return; 435 return;
435 436
436 if (scroller_) 437 if (scroller_)
437 scroller_->OnGestureEvent(event); 438 scroller_->OnGestureEvent(event);
438 event->SetHandled(); 439 event->SetHandled();
439 } 440 }
440 441
441 void MessageView::OnPaintFocusBorder(gfx::Canvas* canvas) { 442 void MessageView::OnPaintFocusBorder(gfx::Canvas* canvas) {
442 if (HasFocus()) { 443 if (HasFocus()) {
443 canvas->DrawRect(gfx::Rect(1, 0, width() - 2, height() - 2), 444 canvas->DrawRect(gfx::Rect(1, 0, width() - 2, height() - 2),
444 message_center::kFocusBorderColor); 445 message_center::kFocusBorderColor);
445 } 446 }
446 } 447 }
447 448
448 void MessageView::ButtonPressed(views::Button* sender, 449 void MessageView::ButtonPressed(views::Button* sender,
449 const ui::Event& event) { 450 const ui::Event& event) {
450 if (sender == close_button()) { 451 if (sender == close_button()) {
451 message_center_->RemoveNotification(notification_id_, true); // By user. 452 message_center_->RemoveNotification(notification_id_, true); // By user.
452 } else if (sender == expand_button()) { 453 } else if (sender == expand_button()) {
453 is_expanded_ = true; 454 is_expanded_ = true;
454 message_center_->ExpandNotification(notification_id_); 455 message_center_->ExpandNotification(notification_id_);
455 } 456 }
456 } 457 }
457 458
458 void MessageView::OnSlideOut() { 459 void MessageView::OnSlideOut() {
459 message_center_->RemoveNotification(notification_id_, true); // By user. 460 message_center_->RemoveNotification(notification_id_, true); // By user.
460 } 461 }
461 462
462 } // namespace message_center 463 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698