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

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

Issue 2712733003: Remove non-MD code from VirtualKeyboardTray (Closed)
Patch Set: Addressed review comments Created 3 years, 10 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
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/gfx/color_palette.h" 9 #include "ui/gfx/color_palette.h"
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 3}; 112 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 3};
113 const int kTrayPopupItemMinHeight[] = {46, 48, 48}; 113 const int kTrayPopupItemMinHeight[] = {46, 48, 48};
114 const int kTrayPopupItemMaxHeight[] = {138, 144, 144}; 114 const int kTrayPopupItemMaxHeight[] = {138, 144, 144};
115 // FixedSizedImageViews use the contained ImageView's width for 0 values. 115 // FixedSizedImageViews use the contained ImageView's width for 0 values.
116 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48}; 116 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48};
117 const int kTrayPopupItemMoreImageSize[] = {25, kMenuIconSize, kMenuIconSize}; 117 const int kTrayPopupItemMoreImageSize[] = {25, kMenuIconSize, kMenuIconSize};
118 const int kTrayPopupItemMoreRegionHorizontalInset[] = {10, 10, 10}; 118 const int kTrayPopupItemMoreRegionHorizontalInset[] = {10, 10, 10};
119 const int kTrayPopupItemLeftInset[] = {0, 4, 4}; 119 const int kTrayPopupItemLeftInset[] = {0, 4, 4};
120 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48}; 120 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48};
121 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40}; 121 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40};
122 const int kVirtualKeyboardButtonSize[] = {39, kTrayItemSize, kTrayItemSize};
123 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; 122 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize};
124 const int kTrayImageItemPadding[] = {1, 3, 3}; 123 const int kTrayImageItemPadding[] = {1, 3, 3};
125 124
126 // TODO(estade): clean this up --- remove unneeded constants and reduce 125 // TODO(estade): clean this up --- remove unneeded constants and reduce
127 // remaining arrays to a single constant. 126 // remaining arrays to a single constant.
128 const int mode = 1; 127 const int mode = 1;
129 switch (constant) { 128 switch (constant) {
130 case TRAY_ITEM_HEIGHT_LEGACY: 129 case TRAY_ITEM_HEIGHT_LEGACY:
131 return kTrayItemHeightLegacy[mode]; 130 return kTrayItemHeightLegacy[mode];
132 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 131 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
133 return kTrayPaddingFromEdgeOfShelf[mode]; 132 return kTrayPaddingFromEdgeOfShelf[mode];
134 case TRAY_POPUP_ITEM_MIN_HEIGHT: 133 case TRAY_POPUP_ITEM_MIN_HEIGHT:
135 return kTrayPopupItemMinHeight[mode]; 134 return kTrayPopupItemMinHeight[mode];
136 case TRAY_POPUP_ITEM_MAX_HEIGHT: 135 case TRAY_POPUP_ITEM_MAX_HEIGHT:
137 return kTrayPopupItemMaxHeight[mode]; 136 return kTrayPopupItemMaxHeight[mode];
138 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: 137 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH:
139 return kTrayPopupItemMainImageRegionWidth[mode]; 138 return kTrayPopupItemMainImageRegionWidth[mode];
140 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: 139 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE:
141 return kTrayPopupItemMoreImageSize[mode]; 140 return kTrayPopupItemMoreImageSize[mode];
142 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: 141 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET:
143 return kTrayPopupItemMoreRegionHorizontalInset[mode]; 142 return kTrayPopupItemMoreRegionHorizontalInset[mode];
144 case TRAY_POPUP_ITEM_LEFT_INSET: 143 case TRAY_POPUP_ITEM_LEFT_INSET:
145 return kTrayPopupItemLeftInset[mode]; 144 return kTrayPopupItemLeftInset[mode];
146 case TRAY_POPUP_ITEM_MIN_START_WIDTH: 145 case TRAY_POPUP_ITEM_MIN_START_WIDTH:
147 return kTrayPopupItemMinStartWidth[mode]; 146 return kTrayPopupItemMinStartWidth[mode];
148 case TRAY_POPUP_ITEM_MIN_END_WIDTH: 147 case TRAY_POPUP_ITEM_MIN_END_WIDTH:
149 return kTrayPopupItemMinEndWidth[mode]; 148 return kTrayPopupItemMinEndWidth[mode];
150 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
151 return kVirtualKeyboardButtonSize[mode];
152 case TRAY_IME_MENU_ICON: 149 case TRAY_IME_MENU_ICON:
153 return kTrayImeMenuIcon[mode]; 150 return kTrayImeMenuIcon[mode];
154 case TRAY_IMAGE_ITEM_PADDING: 151 case TRAY_IMAGE_ITEM_PADDING:
155 return kTrayImageItemPadding[mode]; 152 return kTrayImageItemPadding[mode];
156 } 153 }
157 NOTREACHED(); 154 NOTREACHED();
158 return 0; 155 return 0;
159 } 156 }
160 157
161 } // namespace ash 158 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698