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

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

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: iOS, Windows, and CrOS compile fixes Created 3 years, 9 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 // Default amount content is inset on the left edge. 58 // Default amount content is inset on the left edge.
64 const int kDefaultLeadingInset = 8; 59 const int kDefaultLeadingInset = 8;
65 60
66 // The proportion of the shelf space reserved for non-panel icons. Panels 61 // The proportion of the shelf space reserved for non-panel icons. Panels
67 // may flow into this space but will be put into the overflow bubble if there 62 // may flow into this space but will be put into the overflow bubble if there
68 // is contention for the space. 63 // is contention for the space.
69 const float kReservedNonPanelIconProportion = 0.67f; 64 const float kReservedNonPanelIconProportion = 0.67f;
70 65
71 // The distance of the cursor from the outer rim of the shelf before it 66 // The distance of the cursor from the outer rim of the shelf before it
72 // separates. 67 // separates.
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 1764
1770 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1765 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1771 const gfx::Rect bounds = GetBoundsInScreen(); 1766 const gfx::Rect bounds = GetBoundsInScreen();
1772 int distance = wm_shelf_->SelectValueForShelfAlignment( 1767 int distance = wm_shelf_->SelectValueForShelfAlignment(
1773 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1768 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1774 bounds.x() - coordinate.x()); 1769 bounds.x() - coordinate.x());
1775 return distance > 0 ? distance : 0; 1770 return distance > 0 ? distance : 0;
1776 } 1771 }
1777 1772
1778 } // namespace ash 1773 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698