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/common/system/tray/tray_constants.h" | 5 #include "ash/common/system/tray/tray_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 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 const int kSeparatorWidth = 1; | 90 const int kSeparatorWidth = 1; |
91 | 91 |
92 const SkColor kHorizontalSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); | 92 const SkColor kHorizontalSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); |
93 const int kHorizontalSeparatorHeight = 24; | 93 const int kHorizontalSeparatorHeight = 24; |
94 | 94 |
95 int GetTrayConstant(TrayConstant constant) { | 95 int GetTrayConstant(TrayConstant constant) { |
96 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; | 96 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; |
97 const int kTraySpacing[] = {4, 4, 0}; | 97 const int kTraySpacing[] = {4, 4, 0}; |
98 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; | 98 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; |
99 const int kTrayPopupItemHeight[] = {46, 46, 48}; | 99 const int kTrayPopupItemHeight[] = {46, 46, 48}; |
100 // TODO(bruthig): Use the correct values for non-material design. | |
101 const int kTrayPopupItemLeftInset[] = {0, 0, 4}; | |
102 // TODO(bruthig): Use the correct values for non-material design. | |
103 const int kTrayPopupItemRightInset[] = {0, 0, 4}; | |
104 // TODO(bruthig): Use the correct values for non-material design. | |
105 const int kTrayPopupItemMinStartWidth[] = {48, 48, 48}; | |
106 // TODO(bruthig): Use the correct values for non-material design. | |
107 const int kTrayPopupItemMinEndWidth[] = {48, 48, 48}; | |
108 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; | 100 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; |
109 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; | 101 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; |
110 const int kTrayImageItemPadding[] = {1, 1, 3}; | 102 const int kTrayImageItemPadding[] = {1, 1, 3}; |
111 | 103 |
112 const int mode = MaterialDesignController::GetMode(); | 104 const int mode = MaterialDesignController::GetMode(); |
113 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 105 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
114 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 106 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
115 | 107 |
116 switch (constant) { | 108 switch (constant) { |
117 case TRAY_ITEM_HEIGHT_LEGACY: | 109 case TRAY_ITEM_HEIGHT_LEGACY: |
118 return kTrayItemHeightLegacy[mode]; | 110 return kTrayItemHeightLegacy[mode]; |
119 case TRAY_SPACING: | 111 case TRAY_SPACING: |
120 return kTraySpacing[mode]; | 112 return kTraySpacing[mode]; |
121 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 113 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
122 return kTrayPaddingFromEdgeOfShelf[mode]; | 114 return kTrayPaddingFromEdgeOfShelf[mode]; |
123 case TRAY_POPUP_ITEM_HEIGHT: | 115 case TRAY_POPUP_ITEM_HEIGHT: |
124 return kTrayPopupItemHeight[mode]; | 116 return kTrayPopupItemHeight[mode]; |
125 case TRAY_POPUP_ITEM_LEFT_INSET: | |
126 return kTrayPopupItemLeftInset[mode]; | |
127 case TRAY_POPUP_ITEM_RIGHT_INSET: | |
128 return kTrayPopupItemRightInset[mode]; | |
129 case TRAY_POPUP_ITEM_MIN_START_WIDTH: | |
130 return kTrayPopupItemMinStartWidth[mode]; | |
131 case TRAY_POPUP_ITEM_MIN_END_WIDTH: | |
132 return kTrayPopupItemMinEndWidth[mode]; | |
133 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 117 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
134 return kVirtualKeyboardButtonSize[mode]; | 118 return kVirtualKeyboardButtonSize[mode]; |
135 case TRAY_IME_MENU_ICON: | 119 case TRAY_IME_MENU_ICON: |
136 return kTrayImeMenuIcon[mode]; | 120 return kTrayImeMenuIcon[mode]; |
137 case TRAY_IMAGE_ITEM_PADDING: | 121 case TRAY_IMAGE_ITEM_PADDING: |
138 return kTrayImageItemPadding[mode]; | 122 return kTrayImageItemPadding[mode]; |
139 } | 123 } |
140 NOTREACHED(); | 124 NOTREACHED(); |
141 return 0; | 125 return 0; |
142 } | 126 } |
143 | 127 |
144 } // namespace ash | 128 } // namespace ash |
OLD | NEW |