| 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 28 matching lines...) Expand all Loading... |
| 39 const int kTrayMenuBottomRowPaddingBetweenItems = -1; | 39 const int kTrayMenuBottomRowPaddingBetweenItems = -1; |
| 40 const int kTrayMenuMinimumWidth = 300; | 40 const int kTrayMenuMinimumWidth = 300; |
| 41 const int kTrayMenuMinimumWidthMd = 352; | 41 const int kTrayMenuMinimumWidthMd = 352; |
| 42 | 42 |
| 43 const int kTrayPopupAutoCloseDelayInSeconds = 2; | 43 const int kTrayPopupAutoCloseDelayInSeconds = 2; |
| 44 const int kTrayPopupAutoCloseDelayForTextInSeconds = 5; | 44 const int kTrayPopupAutoCloseDelayForTextInSeconds = 5; |
| 45 const int kTrayPopupPaddingHorizontal = 18; | 45 const int kTrayPopupPaddingHorizontal = 18; |
| 46 const int kTrayPopupPaddingBetweenItems = 10; | 46 const int kTrayPopupPaddingBetweenItems = 10; |
| 47 const int kTrayPopupButtonEndMargin = 10; | 47 const int kTrayPopupButtonEndMargin = 10; |
| 48 const int kTrayPopupLabelHorizontalPadding = 4; | 48 const int kTrayPopupLabelHorizontalPadding = 4; |
| 49 |
| 50 const int kTrayDetailedViewTransitionDelayMs = 100; |
| 51 |
| 49 const int kTrayPopupSliderPaddingMD = 16; | 52 const int kTrayPopupSliderPaddingMD = 16; |
| 50 const int kTrayPopupLabelRightPadding = 8; | 53 const int kTrayPopupLabelRightPadding = 8; |
| 51 | 54 |
| 52 const int kTrayPopupDetailsIconWidth = 25; | 55 const int kTrayPopupDetailsIconWidth = 25; |
| 53 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; | 56 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; |
| 54 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); | 57 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); |
| 55 const int kTrayPopupScrollSeparatorHeight = 15; | 58 const int kTrayPopupScrollSeparatorHeight = 15; |
| 56 const int kTrayRoundedBorderRadius = 2; | 59 const int kTrayRoundedBorderRadius = 2; |
| 57 | 60 |
| 58 const int kTrayToggleButtonWidth = 68; | 61 const int kTrayToggleButtonWidth = 68; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; | 103 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; |
| 101 const float kTrayPopupInkDropRippleOpacity = 0.06f; | 104 const float kTrayPopupInkDropRippleOpacity = 0.06f; |
| 102 const float kTrayPopupInkDropHighlightOpacity = 0.08f; | 105 const float kTrayPopupInkDropHighlightOpacity = 0.08f; |
| 103 const int kTrayPopupInkDropInset = 4; | 106 const int kTrayPopupInkDropInset = 4; |
| 104 const int kTrayPopupInkDropCornerRadius = 2; | 107 const int kTrayPopupInkDropCornerRadius = 2; |
| 105 | 108 |
| 106 const int kTrayPopupSystemInfoRowHeight = 40; | 109 const int kTrayPopupSystemInfoRowHeight = 40; |
| 107 | 110 |
| 108 int GetTrayConstant(TrayConstant constant) { | 111 int GetTrayConstant(TrayConstant constant) { |
| 109 const int kTrayItemHeightLegacy[] = {38, kTrayItemSize, kTrayItemSize}; | 112 const int kTrayItemHeightLegacy[] = {38, kTrayItemSize, kTrayItemSize}; |
| 110 const int kTraySpacing[] = {4, 0, 0}; | |
| 111 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 3}; | 113 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 3}; |
| 112 const int kTrayPopupItemMinHeight[] = {46, 48, 48}; | 114 const int kTrayPopupItemMinHeight[] = {46, 48, 48}; |
| 113 const int kTrayPopupItemMaxHeight[] = {138, 144, 144}; | 115 const int kTrayPopupItemMaxHeight[] = {138, 144, 144}; |
| 114 // FixedSizedImageViews use the contained ImageView's width for 0 values. | 116 // FixedSizedImageViews use the contained ImageView's width for 0 values. |
| 115 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48}; | 117 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48}; |
| 116 const int kTrayPopupItemMoreImageSize[] = {25, kMenuIconSize, kMenuIconSize}; | 118 const int kTrayPopupItemMoreImageSize[] = {25, kMenuIconSize, kMenuIconSize}; |
| 117 const int kTrayPopupItemMoreRegionHorizontalInset[] = {10, 10, 10}; | 119 const int kTrayPopupItemMoreRegionHorizontalInset[] = {10, 10, 10}; |
| 118 const int kTrayPopupItemLeftInset[] = {0, 4, 4}; | 120 const int kTrayPopupItemLeftInset[] = {0, 4, 4}; |
| 119 const int kTrayPopupItemRightInset[] = {0, 0, 0}; | |
| 120 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48}; | 121 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48}; |
| 121 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40}; | 122 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40}; |
| 122 const int kTrayPopupTransitionToDefaultViewDelayMs[] = {0, 100, 100}; | |
| 123 const int kTrayPopupTransitionToDetailedViewDelayMs[] = {0, 100, 100}; | |
| 124 const int kVirtualKeyboardButtonSize[] = {39, kTrayItemSize, kTrayItemSize}; | 123 const int kVirtualKeyboardButtonSize[] = {39, kTrayItemSize, kTrayItemSize}; |
| 125 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; | 124 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; |
| 126 const int kTrayImageItemPadding[] = {1, 3, 3}; | 125 const int kTrayImageItemPadding[] = {1, 3, 3}; |
| 127 | 126 |
| 128 // TODO(estade): clean this up --- remove unneeded constants and reduce | 127 // TODO(estade): clean this up --- remove unneeded constants and reduce |
| 129 // remaining arrays to a single constant. | 128 // remaining arrays to a single constant. |
| 130 const int mode = 1; | 129 const int mode = 1; |
| 131 switch (constant) { | 130 switch (constant) { |
| 132 case TRAY_ITEM_HEIGHT_LEGACY: | 131 case TRAY_ITEM_HEIGHT_LEGACY: |
| 133 return kTrayItemHeightLegacy[mode]; | 132 return kTrayItemHeightLegacy[mode]; |
| 134 case TRAY_SPACING: | |
| 135 return kTraySpacing[mode]; | |
| 136 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 133 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
| 137 return kTrayPaddingFromEdgeOfShelf[mode]; | 134 return kTrayPaddingFromEdgeOfShelf[mode]; |
| 138 case TRAY_POPUP_ITEM_MIN_HEIGHT: | 135 case TRAY_POPUP_ITEM_MIN_HEIGHT: |
| 139 return kTrayPopupItemMinHeight[mode]; | 136 return kTrayPopupItemMinHeight[mode]; |
| 140 case TRAY_POPUP_ITEM_MAX_HEIGHT: | 137 case TRAY_POPUP_ITEM_MAX_HEIGHT: |
| 141 return kTrayPopupItemMaxHeight[mode]; | 138 return kTrayPopupItemMaxHeight[mode]; |
| 142 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: | 139 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: |
| 143 return kTrayPopupItemMainImageRegionWidth[mode]; | 140 return kTrayPopupItemMainImageRegionWidth[mode]; |
| 144 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: | 141 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: |
| 145 return kTrayPopupItemMoreImageSize[mode]; | 142 return kTrayPopupItemMoreImageSize[mode]; |
| 146 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: | 143 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: |
| 147 return kTrayPopupItemMoreRegionHorizontalInset[mode]; | 144 return kTrayPopupItemMoreRegionHorizontalInset[mode]; |
| 148 case TRAY_POPUP_ITEM_LEFT_INSET: | 145 case TRAY_POPUP_ITEM_LEFT_INSET: |
| 149 return kTrayPopupItemLeftInset[mode]; | 146 return kTrayPopupItemLeftInset[mode]; |
| 150 case TRAY_POPUP_ITEM_RIGHT_INSET: | |
| 151 return kTrayPopupItemRightInset[mode]; | |
| 152 case TRAY_POPUP_ITEM_MIN_START_WIDTH: | 147 case TRAY_POPUP_ITEM_MIN_START_WIDTH: |
| 153 return kTrayPopupItemMinStartWidth[mode]; | 148 return kTrayPopupItemMinStartWidth[mode]; |
| 154 case TRAY_POPUP_ITEM_MIN_END_WIDTH: | 149 case TRAY_POPUP_ITEM_MIN_END_WIDTH: |
| 155 return kTrayPopupItemMinEndWidth[mode]; | 150 return kTrayPopupItemMinEndWidth[mode]; |
| 156 case TRAY_POPUP_TRANSITION_TO_DEFAULT_DELAY: | |
| 157 return kTrayPopupTransitionToDefaultViewDelayMs[mode]; | |
| 158 case TRAY_POPUP_TRANSITION_TO_DETAILED_DELAY: | |
| 159 return kTrayPopupTransitionToDetailedViewDelayMs[mode]; | |
| 160 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 151 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
| 161 return kVirtualKeyboardButtonSize[mode]; | 152 return kVirtualKeyboardButtonSize[mode]; |
| 162 case TRAY_IME_MENU_ICON: | 153 case TRAY_IME_MENU_ICON: |
| 163 return kTrayImeMenuIcon[mode]; | 154 return kTrayImeMenuIcon[mode]; |
| 164 case TRAY_IMAGE_ITEM_PADDING: | 155 case TRAY_IMAGE_ITEM_PADDING: |
| 165 return kTrayImageItemPadding[mode]; | 156 return kTrayImageItemPadding[mode]; |
| 166 } | 157 } |
| 167 NOTREACHED(); | 158 NOTREACHED(); |
| 168 return 0; | 159 return 0; |
| 169 } | 160 } |
| 170 | 161 |
| 171 } // namespace ash | 162 } // namespace ash |
| OLD | NEW |