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

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

Issue 2174643002: [ash-md] Updates ash shelf tooltips to MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_constants.h" 5 #include "ash/common/shelf/shelf_constants.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 10
(...skipping 15 matching lines...) Expand all
26 const int kOverflowButtonCornerRadius = 2; 26 const int kOverflowButtonCornerRadius = 2;
27 const int kAppListButtonRadius = kOverflowButtonSize / 2; 27 const int kAppListButtonRadius = kOverflowButtonSize / 2;
28 28
29 int GetShelfConstant(ShelfConstant shelf_constant) { 29 int GetShelfConstant(ShelfConstant shelf_constant) {
30 const int kShelfBackgroundAlpha[] = {204, 204, 153}; 30 const int kShelfBackgroundAlpha[] = {204, 204, 153};
31 const int kShelfSize[] = {47, 47, 48}; 31 const int kShelfSize[] = {47, 47, 48};
32 const int kShelfButtonSpacing[] = {10, 10, 16}; 32 const int kShelfButtonSpacing[] = {10, 10, 16};
33 const int kShelfButtonSize[] = {44, 44, 48}; 33 const int kShelfButtonSize[] = {44, 44, 48};
34 const int kShelfInsetsForAutoHide[] = {3, 3, 0}; 34 const int kShelfInsetsForAutoHide[] = {3, 3, 0};
35 35
36 // Tooltip constants.
37 const int kTooltipHeight[] = {29, 29, 24};
38 const int kTooltipMaxWidth[] = {250, 250, 250};
39 const int kTooltipTopBottomMargin[] = {3, 3, 4};
40 const int kTooltipLeftRightMargin[] = {10, 10, 8};
41 const int kArrowTopBottomOffset[] = {7, 7, -1};
42 const int kArrowLeftRightOffset[] = {11, 11, -1};
43
36 const int mode = MaterialDesignController::GetMode(); 44 const int mode = MaterialDesignController::GetMode();
37 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 45 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
38 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 46 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
39 47
40 switch (shelf_constant) { 48 switch (shelf_constant) {
41 case SHELF_BACKGROUND_ALPHA: 49 case SHELF_BACKGROUND_ALPHA:
42 return kShelfBackgroundAlpha[mode]; 50 return kShelfBackgroundAlpha[mode];
43 case SHELF_SIZE: 51 case SHELF_SIZE:
44 return kShelfSize[mode]; 52 return kShelfSize[mode];
45 case SHELF_BUTTON_SPACING: 53 case SHELF_BUTTON_SPACING:
46 return kShelfButtonSpacing[mode]; 54 return kShelfButtonSpacing[mode];
47 case SHELF_BUTTON_SIZE: 55 case SHELF_BUTTON_SIZE:
48 return kShelfButtonSize[mode]; 56 return kShelfButtonSize[mode];
49 case SHELF_INSETS_FOR_AUTO_HIDE: 57 case SHELF_INSETS_FOR_AUTO_HIDE:
50 return kShelfInsetsForAutoHide[mode]; 58 return kShelfInsetsForAutoHide[mode];
59 case TOOLTIP_HEIGHT:
60 return kTooltipHeight[mode];
61 case TOOLTIP_MAX_WIDTH:
62 return kTooltipMaxWidth[mode];
63 case TOOLTIP_TOP_BOTTOM_MARGIN:
64 return kTooltipTopBottomMargin[mode];
65 case TOOLTIP_LEFT_RIGHT_MARGIN:
66 return kTooltipLeftRightMargin[mode];
67 case TOOLTIP_ARROW_TOP_BOTTOM_OFFSET:
68 return kArrowTopBottomOffset[mode];
69 case TOOLTIP_ARROW_LEFT_RIGHT_OFFSET:
70 return kArrowLeftRightOffset[mode];
51 } 71 }
52 NOTREACHED(); 72 NOTREACHED();
53 return 0; 73 return 0;
54 } 74 }
55 75
56 } // namespace ash 76 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698