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

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

Issue 2414103003: Added common layout framework for system menu rows. (Closed)
Patch Set: Moved |layout_manager_| destruction order in ~View(). 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};
99 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; 107 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
100 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; 108 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize};
101 const int kTrayImageItemPadding[] = {1, 1, 3}; 109 const int kTrayImageItemPadding[] = {1, 1, 3};
102 110
103 const int mode = MaterialDesignController::GetMode(); 111 const int mode = MaterialDesignController::GetMode();
104 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 112 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
105 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 113 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
106 114
107 switch (constant) { 115 switch (constant) {
108 case TRAY_ITEM_HEIGHT_LEGACY: 116 case TRAY_ITEM_HEIGHT_LEGACY:
109 return kTrayItemHeightLegacy[mode]; 117 return kTrayItemHeightLegacy[mode];
110 case TRAY_SPACING: 118 case TRAY_SPACING:
111 return kTraySpacing[mode]; 119 return kTraySpacing[mode];
112 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 120 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
113 return kTrayPaddingFromEdgeOfShelf[mode]; 121 return kTrayPaddingFromEdgeOfShelf[mode];
114 case TRAY_POPUP_ITEM_HEIGHT: 122 case TRAY_POPUP_ITEM_HEIGHT:
115 return kTrayPopupItemHeight[mode]; 123 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];
116 case VIRTUAL_KEYBOARD_BUTTON_SIZE: 132 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
117 return kVirtualKeyboardButtonSize[mode]; 133 return kVirtualKeyboardButtonSize[mode];
118 case TRAY_IME_MENU_ICON: 134 case TRAY_IME_MENU_ICON:
119 return kTrayImeMenuIcon[mode]; 135 return kTrayImeMenuIcon[mode];
120 case TRAY_IMAGE_ITEM_PADDING: 136 case TRAY_IMAGE_ITEM_PADDING:
121 return kTrayImageItemPadding[mode]; 137 return kTrayImageItemPadding[mode];
122 } 138 }
123 NOTREACHED(); 139 NOTREACHED();
124 return 0; 140 return 0;
125 } 141 }
126 142
127 } // namespace ash 143 } // 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