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

Side by Side Diff: ash/common/system/tray/tray_constants.cc

Issue 2441923004: Revert of Added common layout framework for system menu rows. (Closed)
Patch Set: Created 4 years, 2 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/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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const int kSeparatorWidth = 1; 89 const int kSeparatorWidth = 1;
90 90
91 const SkColor kHorizontalSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); 91 const SkColor kHorizontalSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F);
92 const int kHorizontalSeparatorHeight = 24; 92 const int kHorizontalSeparatorHeight = 24;
93 93
94 int GetTrayConstant(TrayConstant constant) { 94 int GetTrayConstant(TrayConstant constant) {
95 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; 95 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize};
96 const int kTraySpacing[] = {4, 4, 0}; 96 const int kTraySpacing[] = {4, 4, 0};
97 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; 97 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4};
98 const int kTrayPopupItemHeight[] = {46, 46, 48}; 98 const int kTrayPopupItemHeight[] = {46, 46, 48};
99 // TODO(bruthig): Use the correct values for non-material design.
100 const int kTrayPopupItemLeftInset[] = {0, 0, 4};
101 // TODO(bruthig): Use the correct values for non-material design.
102 const int kTrayPopupItemRightInset[] = {0, 0, 4};
103 // TODO(bruthig): Use the correct values for non-material design.
104 const int kTrayPopupItemMinStartWidth[] = {48, 48, 48};
105 // TODO(bruthig): Use the correct values for non-material design.
106 const int kTrayPopupItemMinEndWidth[] = {48, 48, 48};
107 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; 99 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
108 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; 100 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize};
109 const int kTrayImageItemPadding[] = {1, 1, 3}; 101 const int kTrayImageItemPadding[] = {1, 1, 3};
110 102
111 const int mode = MaterialDesignController::GetMode(); 103 const int mode = MaterialDesignController::GetMode();
112 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 104 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
113 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 105 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
114 106
115 switch (constant) { 107 switch (constant) {
116 case TRAY_ITEM_HEIGHT_LEGACY: 108 case TRAY_ITEM_HEIGHT_LEGACY:
117 return kTrayItemHeightLegacy[mode]; 109 return kTrayItemHeightLegacy[mode];
118 case TRAY_SPACING: 110 case TRAY_SPACING:
119 return kTraySpacing[mode]; 111 return kTraySpacing[mode];
120 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 112 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
121 return kTrayPaddingFromEdgeOfShelf[mode]; 113 return kTrayPaddingFromEdgeOfShelf[mode];
122 case TRAY_POPUP_ITEM_HEIGHT: 114 case TRAY_POPUP_ITEM_HEIGHT:
123 return kTrayPopupItemHeight[mode]; 115 return kTrayPopupItemHeight[mode];
124 case TRAY_POPUP_ITEM_LEFT_INSET:
125 return kTrayPopupItemLeftInset[mode];
126 case TRAY_POPUP_ITEM_RIGHT_INSET:
127 return kTrayPopupItemRightInset[mode];
128 case TRAY_POPUP_ITEM_MIN_START_WIDTH:
129 return kTrayPopupItemMinStartWidth[mode];
130 case TRAY_POPUP_ITEM_MIN_END_WIDTH:
131 return kTrayPopupItemMinEndWidth[mode];
132 case VIRTUAL_KEYBOARD_BUTTON_SIZE: 116 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
133 return kVirtualKeyboardButtonSize[mode]; 117 return kVirtualKeyboardButtonSize[mode];
134 case TRAY_IME_MENU_ICON: 118 case TRAY_IME_MENU_ICON:
135 return kTrayImeMenuIcon[mode]; 119 return kTrayImeMenuIcon[mode];
136 case TRAY_IMAGE_ITEM_PADDING: 120 case TRAY_IMAGE_ITEM_PADDING:
137 return kTrayImageItemPadding[mode]; 121 return kTrayImageItemPadding[mode];
138 } 122 }
139 NOTREACHED(); 123 NOTREACHED();
140 return 0; 124 return 0;
141 } 125 }
142 126
143 } // namespace ash 127 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/common/system/tray/tray_popup_layout_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698