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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: nocompile test Created 3 years, 6 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
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698