| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_constants.h" | 5 #include "ash/common/shelf/shelf_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 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 const SkColor kShelfIconColor = SK_ColorWHITE; | 24 const SkColor kShelfIconColor = SK_ColorWHITE; |
| 25 const int kOverflowButtonSize = 32; | 25 const int kOverflowButtonSize = 32; |
| 26 const int kOverflowButtonCornerRadius = 2; | 26 const int kOverflowButtonCornerRadius = 2; |
| 27 const int kAppListButtonRadius = kOverflowButtonSize / 2; | 27 const int kAppListButtonRadius = kOverflowButtonSize / 2; |
| 28 | 28 |
| 29 int GetShelfConstant(ShelfConstant shelf_constant) { | 29 int GetShelfConstant(ShelfConstant shelf_constant) { |
| 30 const int kShelfBackgroundAlpha[] = {204, 204, 153}; | 30 const int kShelfBackgroundAlpha[] = {204, 204, 153}; |
| 31 const int kShelfSize[] = {47, 47, 48}; | 31 const int kShelfSize[] = {47, 47, 48}; |
| 32 const int kShelfButtonSpacing[] = {10, 10, 16}; | 32 const int kShelfButtonSpacing[] = {10, 10, 16}; |
| 33 const int kShelfButtonSize[] = {44, 44, 48}; | 33 const int kShelfButtonSize[] = {44, 44, 48}; |
| 34 const int kShelfInsetsForAutoHide[] = {3, 3, 0}; | 34 const int kShelfInsetsForAutoHide[] = {3, 0, 0}; |
| 35 | 35 |
| 36 const int mode = MaterialDesignController::GetMode(); | 36 const int mode = MaterialDesignController::GetMode(); |
| 37 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 37 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 38 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 38 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 39 | 39 |
| 40 switch (shelf_constant) { | 40 switch (shelf_constant) { |
| 41 case SHELF_BACKGROUND_ALPHA: | 41 case SHELF_BACKGROUND_ALPHA: |
| 42 return kShelfBackgroundAlpha[mode]; | 42 return kShelfBackgroundAlpha[mode]; |
| 43 case SHELF_SIZE: | 43 case SHELF_SIZE: |
| 44 return kShelfSize[mode]; | 44 return kShelfSize[mode]; |
| 45 case SHELF_BUTTON_SPACING: | 45 case SHELF_BUTTON_SPACING: |
| 46 return kShelfButtonSpacing[mode]; | 46 return kShelfButtonSpacing[mode]; |
| 47 case SHELF_BUTTON_SIZE: | 47 case SHELF_BUTTON_SIZE: |
| 48 return kShelfButtonSize[mode]; | 48 return kShelfButtonSize[mode]; |
| 49 case SHELF_INSETS_FOR_AUTO_HIDE: | 49 case SHELF_INSETS_FOR_AUTO_HIDE: |
| 50 return kShelfInsetsForAutoHide[mode]; | 50 return kShelfInsetsForAutoHide[mode]; |
| 51 } | 51 } |
| 52 NOTREACHED(); | 52 NOTREACHED(); |
| 53 return 0; | 53 return 0; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace ash | 56 } // namespace ash |
| OLD | NEW |