| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/shelf/shelf_button.h" | 5 #include "ash/shelf/shelf_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/shelf/ink_drop_button_listener.h" | 10 #include "ash/shelf/ink_drop_button_listener.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 return; | 450 return; |
| 451 case ui::ET_GESTURE_SCROLL_UPDATE: | 451 case ui::ET_GESTURE_SCROLL_UPDATE: |
| 452 shelf_view_->PointerDraggedOnButton(this, ShelfView::TOUCH, *event); | 452 shelf_view_->PointerDraggedOnButton(this, ShelfView::TOUCH, *event); |
| 453 event->SetHandled(); | 453 event->SetHandled(); |
| 454 return; | 454 return; |
| 455 case ui::ET_GESTURE_SCROLL_END: | 455 case ui::ET_GESTURE_SCROLL_END: |
| 456 case ui::ET_SCROLL_FLING_START: | 456 case ui::ET_SCROLL_FLING_START: |
| 457 shelf_view_->PointerReleasedOnButton(this, ShelfView::TOUCH, false); | 457 shelf_view_->PointerReleasedOnButton(this, ShelfView::TOUCH, false); |
| 458 event->SetHandled(); | 458 event->SetHandled(); |
| 459 return; | 459 return; |
| 460 case ui::ET_GESTURE_LONG_TAP: |
| 461 // Handle LONG_TAP to avoid opening the context menu twice. |
| 462 event->SetHandled(); |
| 463 return; |
| 460 default: | 464 default: |
| 461 return CustomButton::OnGestureEvent(event); | 465 return CustomButton::OnGestureEvent(event); |
| 462 } | 466 } |
| 463 } | 467 } |
| 464 | 468 |
| 465 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const { | 469 std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const { |
| 466 return base::MakeUnique<views::SquareInkDropRipple>( | 470 return base::MakeUnique<views::SquareInkDropRipple>( |
| 467 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), | 471 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), |
| 468 kInkDropLargeCornerRadius, | 472 kInkDropLargeCornerRadius, |
| 469 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), | 473 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 icon_view_->SetHorizontalAlignment(is_horizontal_shelf | 505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf |
| 502 ? views::ImageView::CENTER | 506 ? views::ImageView::CENTER |
| 503 : views::ImageView::LEADING); | 507 : views::ImageView::LEADING); |
| 504 icon_view_->SetVerticalAlignment(is_horizontal_shelf | 508 icon_view_->SetVerticalAlignment(is_horizontal_shelf |
| 505 ? views::ImageView::LEADING | 509 ? views::ImageView::LEADING |
| 506 : views::ImageView::CENTER); | 510 : views::ImageView::CENTER); |
| 507 SchedulePaint(); | 511 SchedulePaint(); |
| 508 } | 512 } |
| 509 | 513 |
| 510 } // namespace ash | 514 } // namespace ash |
| OLD | NEW |