| 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 "ash/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 is_repost_event_on_same_item_ = | 655 is_repost_event_on_same_item_ = |
| 656 IsRepostEvent(event) && (last_pressed_index_ == index); | 656 IsRepostEvent(event) && (last_pressed_index_ == index); |
| 657 | 657 |
| 658 if (pointer == TOUCH) | 658 if (pointer == TOUCH) |
| 659 touch_press_time_ = base::TimeTicks::Now(); | 659 touch_press_time_ = base::TimeTicks::Now(); |
| 660 | 660 |
| 661 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); | 661 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); |
| 662 drag_view_ = static_cast<ShelfButton*>(view); | 662 drag_view_ = static_cast<ShelfButton*>(view); |
| 663 drag_origin_ = gfx::Point(event.x(), event.y()); | 663 drag_origin_ = gfx::Point(event.x(), event.y()); |
| 664 UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentUsage", | 664 UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentUsage", |
| 665 shelf_->SelectValueForShelfAlignment( | 665 static_cast<ShelfAlignmentUmaEnumValue>( |
| 666 SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, | 666 shelf_->SelectValueForShelfAlignment( |
| 667 SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, | 667 SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, |
| 668 SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT), | 668 SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, |
| 669 SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT)), |
| 669 SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); | 670 SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); |
| 670 } | 671 } |
| 671 | 672 |
| 672 void ShelfView::PointerDraggedOnButton(views::View* view, | 673 void ShelfView::PointerDraggedOnButton(views::View* view, |
| 673 Pointer pointer, | 674 Pointer pointer, |
| 674 const ui::LocatedEvent& event) { | 675 const ui::LocatedEvent& event) { |
| 675 if (CanPrepareForDrag(pointer, event)) | 676 if (CanPrepareForDrag(pointer, event)) |
| 676 PrepareForDrag(pointer, event); | 677 PrepareForDrag(pointer, event); |
| 677 | 678 |
| 678 if (drag_pointer_ == pointer) | 679 if (drag_pointer_ == pointer) |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 if (pointer == TOUCH && | 1823 if (pointer == TOUCH && |
| 1823 (base::TimeTicks::Now() - touch_press_time_) < | 1824 (base::TimeTicks::Now() - touch_press_time_) < |
| 1824 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { | 1825 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { |
| 1825 return false; | 1826 return false; |
| 1826 } | 1827 } |
| 1827 | 1828 |
| 1828 return true; | 1829 return true; |
| 1829 } | 1830 } |
| 1830 | 1831 |
| 1831 } // namespace ash | 1832 } // namespace ash |
| OLD | NEW |