| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 is_repost_event_on_same_item_ = | 670 is_repost_event_on_same_item_ = |
| 671 IsRepostEvent(event) && (last_pressed_index_ == index); | 671 IsRepostEvent(event) && (last_pressed_index_ == index); |
| 672 | 672 |
| 673 if (pointer == TOUCH) | 673 if (pointer == TOUCH) |
| 674 touch_press_time_ = base::TimeTicks::Now(); | 674 touch_press_time_ = base::TimeTicks::Now(); |
| 675 | 675 |
| 676 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); | 676 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); |
| 677 drag_view_ = static_cast<ShelfButton*>(view); | 677 drag_view_ = static_cast<ShelfButton*>(view); |
| 678 drag_origin_ = gfx::Point(event.x(), event.y()); | 678 drag_origin_ = gfx::Point(event.x(), event.y()); |
| 679 UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentUsage", | 679 UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentUsage", |
| 680 shelf_->SelectValueForShelfAlignment( | 680 static_cast<ShelfAlignmentUmaEnumValue>( |
| 681 SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, | 681 shelf_->SelectValueForShelfAlignment( |
| 682 SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, | 682 SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, |
| 683 SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT), | 683 SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, |
| 684 SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT)), |
| 684 SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); | 685 SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); |
| 685 } | 686 } |
| 686 | 687 |
| 687 void ShelfView::PointerDraggedOnButton(views::View* view, | 688 void ShelfView::PointerDraggedOnButton(views::View* view, |
| 688 Pointer pointer, | 689 Pointer pointer, |
| 689 const ui::LocatedEvent& event) { | 690 const ui::LocatedEvent& event) { |
| 690 if (CanPrepareForDrag(pointer, event)) | 691 if (CanPrepareForDrag(pointer, event)) |
| 691 PrepareForDrag(pointer, event); | 692 PrepareForDrag(pointer, event); |
| 692 | 693 |
| 693 if (drag_pointer_ == pointer) | 694 if (drag_pointer_ == pointer) |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 if (pointer == TOUCH && | 1867 if (pointer == TOUCH && |
| 1867 (base::TimeTicks::Now() - touch_press_time_) < | 1868 (base::TimeTicks::Now() - touch_press_time_) < |
| 1868 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { | 1869 base::TimeDelta::FromMilliseconds(kTouchDragTimeThresholdMs)) { |
| 1869 return false; | 1870 return false; |
| 1870 } | 1871 } |
| 1871 | 1872 |
| 1872 return true; | 1873 return true; |
| 1873 } | 1874 } |
| 1874 | 1875 |
| 1875 } // namespace ash | 1876 } // namespace ash |
| OLD | NEW |