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

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

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: rebase Created 3 years, 8 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/common/shelf/shelf_view.h" 5 #include "ash/common/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "ui/views/view_model.h" 48 #include "ui/views/view_model.h"
49 #include "ui/views/view_model_utils.h" 49 #include "ui/views/view_model_utils.h"
50 #include "ui/views/widget/widget.h" 50 #include "ui/views/widget/widget.h"
51 #include "ui/wm/core/coordinate_conversion.h" 51 #include "ui/wm/core/coordinate_conversion.h"
52 52
53 using gfx::Animation; 53 using gfx::Animation;
54 using views::View; 54 using views::View;
55 55
56 namespace ash { 56 namespace ash {
57 57
58 const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM = 0;
59 const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT = 1;
60 const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT = 2;
61 const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT = 3;
62
63 // The proportion of the shelf space reserved for non-panel icons. Panels 58 // The proportion of the shelf space reserved for non-panel icons. Panels
64 // may flow into this space but will be put into the overflow bubble if there 59 // may flow into this space but will be put into the overflow bubble if there
65 // is contention for the space. 60 // is contention for the space.
66 const float kReservedNonPanelIconProportion = 0.67f; 61 const float kReservedNonPanelIconProportion = 0.67f;
67 62
68 // The distance of the cursor from the outer rim of the shelf before it 63 // The distance of the cursor from the outer rim of the shelf before it
69 // separates. 64 // separates.
70 const int kRipOffDistance = 48; 65 const int kRipOffDistance = 48;
71 66
72 // The rip off drag and drop proxy image should get scaled by this factor. 67 // The rip off drag and drop proxy image should get scaled by this factor.
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 1756
1762 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1757 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1763 const gfx::Rect bounds = GetBoundsInScreen(); 1758 const gfx::Rect bounds = GetBoundsInScreen();
1764 int distance = wm_shelf_->SelectValueForShelfAlignment( 1759 int distance = wm_shelf_->SelectValueForShelfAlignment(
1765 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1760 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1766 bounds.x() - coordinate.x()); 1761 bounds.x() - coordinate.x());
1767 return distance > 0 ? distance : 0; 1762 return distance > 0 ? distance : 0;
1768 } 1763 }
1769 1764
1770 } // namespace ash 1765 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698