| 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 "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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const SkColor kMenuSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); | 100 const SkColor kMenuSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); |
| 101 | 101 |
| 102 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; | 102 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; |
| 103 const float kTrayPopupInkDropRippleOpacity = 0.06f; | 103 const float kTrayPopupInkDropRippleOpacity = 0.06f; |
| 104 const float kTrayPopupInkDropHighlightOpacity = 0.08f; | 104 const float kTrayPopupInkDropHighlightOpacity = 0.08f; |
| 105 const int kTrayPopupInkDropInset = 4; | 105 const int kTrayPopupInkDropInset = 4; |
| 106 const int kTrayPopupInkDropCornerRadius = 2; | 106 const int kTrayPopupInkDropCornerRadius = 2; |
| 107 | 107 |
| 108 const int kTrayPopupSystemInfoRowHeight = 40; | 108 const int kTrayPopupSystemInfoRowHeight = 40; |
| 109 | 109 |
| 110 const int kTrayPaddingFromEdgeOfShelf = 3; |
| 111 |
| 110 int GetTrayConstant(TrayConstant constant) { | 112 int GetTrayConstant(TrayConstant constant) { |
| 111 const int kTrayItemHeightLegacy[] = {38, kTrayItemSize, kTrayItemSize}; | |
| 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 kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; | 122 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; |
| 123 const int kTrayImageItemPadding[] = {1, 3, 3}; | 123 const int kTrayImageItemPadding[] = {1, 3, 3}; |
| 124 | 124 |
| 125 // TODO(estade): clean this up --- remove unneeded constants and reduce | 125 // TODO(estade): clean this up --- remove unneeded constants and reduce |
| 126 // remaining arrays to a single constant. | 126 // remaining arrays to a single constant. |
| 127 const int mode = 1; | 127 const int mode = 1; |
| 128 switch (constant) { | 128 switch (constant) { |
| 129 case TRAY_ITEM_HEIGHT_LEGACY: | |
| 130 return kTrayItemHeightLegacy[mode]; | |
| 131 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | |
| 132 return kTrayPaddingFromEdgeOfShelf[mode]; | |
| 133 case TRAY_POPUP_ITEM_MIN_HEIGHT: | 129 case TRAY_POPUP_ITEM_MIN_HEIGHT: |
| 134 return kTrayPopupItemMinHeight[mode]; | 130 return kTrayPopupItemMinHeight[mode]; |
| 135 case TRAY_POPUP_ITEM_MAX_HEIGHT: | 131 case TRAY_POPUP_ITEM_MAX_HEIGHT: |
| 136 return kTrayPopupItemMaxHeight[mode]; | 132 return kTrayPopupItemMaxHeight[mode]; |
| 137 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: | 133 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: |
| 138 return kTrayPopupItemMainImageRegionWidth[mode]; | 134 return kTrayPopupItemMainImageRegionWidth[mode]; |
| 139 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: | 135 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: |
| 140 return kTrayPopupItemMoreImageSize[mode]; | 136 return kTrayPopupItemMoreImageSize[mode]; |
| 141 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: | 137 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: |
| 142 return kTrayPopupItemMoreRegionHorizontalInset[mode]; | 138 return kTrayPopupItemMoreRegionHorizontalInset[mode]; |
| 143 case TRAY_POPUP_ITEM_LEFT_INSET: | 139 case TRAY_POPUP_ITEM_LEFT_INSET: |
| 144 return kTrayPopupItemLeftInset[mode]; | 140 return kTrayPopupItemLeftInset[mode]; |
| 145 case TRAY_POPUP_ITEM_MIN_START_WIDTH: | 141 case TRAY_POPUP_ITEM_MIN_START_WIDTH: |
| 146 return kTrayPopupItemMinStartWidth[mode]; | 142 return kTrayPopupItemMinStartWidth[mode]; |
| 147 case TRAY_POPUP_ITEM_MIN_END_WIDTH: | 143 case TRAY_POPUP_ITEM_MIN_END_WIDTH: |
| 148 return kTrayPopupItemMinEndWidth[mode]; | 144 return kTrayPopupItemMinEndWidth[mode]; |
| 149 case TRAY_IME_MENU_ICON: | 145 case TRAY_IME_MENU_ICON: |
| 150 return kTrayImeMenuIcon[mode]; | 146 return kTrayImeMenuIcon[mode]; |
| 151 case TRAY_IMAGE_ITEM_PADDING: | 147 case TRAY_IMAGE_ITEM_PADDING: |
| 152 return kTrayImageItemPadding[mode]; | 148 return kTrayImageItemPadding[mode]; |
| 153 } | 149 } |
| 154 NOTREACHED(); | 150 NOTREACHED(); |
| 155 return 0; | 151 return 0; |
| 156 } | 152 } |
| 157 | 153 |
| 158 } // namespace ash | 154 } // namespace ash |
| OLD | NEW |