| 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 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 const int kInvalidImageResourceID = -1; | 13 const int kInvalidImageResourceID = -1; |
| 14 const int kTimeToSwitchBackgroundMs = 1000; | 14 const int kTimeToSwitchBackgroundMs = 1000; |
| 15 const int kWorkspaceAreaVisibleInset = 2; | 15 const int kWorkspaceAreaVisibleInset = 2; |
| 16 const int kWorkspaceAreaAutoHideInset = 5; | 16 const int kWorkspaceAreaAutoHideInset = 5; |
| 17 const int kShelfAutoHideSize = 3; | 17 const int kShelfAutoHideSize = 3; |
| 18 const int kShelfItemInset = 3; | 18 const int kShelfItemInset = 3; |
| 19 const SkColor kShelfBaseColor = SK_ColorBLACK; | 19 const SkColor kShelfBaseColor = SK_ColorBLACK; |
| 20 const SkColor kShelfButtonActivatedHighlightColor = | 20 const SkColor kShelfButtonActivatedHighlightColor = |
| 21 SkColorSetA(SK_ColorWHITE, 100); | 21 SkColorSetA(SK_ColorWHITE, 100); |
| 22 const SkColor kShelfInkDropBaseColor = SK_ColorWHITE; |
| 22 const float kShelfInkDropVisibleOpacity = 0.2f; | 23 const float kShelfInkDropVisibleOpacity = 0.2f; |
| 23 const SkColor kShelfIconColor = SK_ColorWHITE; | 24 const SkColor kShelfIconColor = SK_ColorWHITE; |
| 24 | 25 |
| 25 int GetShelfConstant(ShelfConstant shelf_constant) { | 26 int GetShelfConstant(ShelfConstant shelf_constant) { |
| 26 const int kShelfBackgroundAlpha[] = {204, 204, 153}; | 27 const int kShelfBackgroundAlpha[] = {204, 204, 153}; |
| 27 const int kShelfSize[] = {47, 47, 48}; | 28 const int kShelfSize[] = {47, 47, 48}; |
| 28 const int kShelfButtonSpacing[] = {10, 10, 16}; | 29 const int kShelfButtonSpacing[] = {10, 10, 16}; |
| 29 const int kShelfButtonSize[] = {44, 44, 48}; | 30 const int kShelfButtonSize[] = {44, 44, 48}; |
| 30 | 31 |
| 31 const int mode = MaterialDesignController::GetMode(); | 32 const int mode = MaterialDesignController::GetMode(); |
| 32 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 33 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 33 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 34 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 34 | 35 |
| 35 switch (shelf_constant) { | 36 switch (shelf_constant) { |
| 36 case SHELF_BACKGROUND_ALPHA: | 37 case SHELF_BACKGROUND_ALPHA: |
| 37 return kShelfBackgroundAlpha[mode]; | 38 return kShelfBackgroundAlpha[mode]; |
| 38 case SHELF_SIZE: | 39 case SHELF_SIZE: |
| 39 return kShelfSize[mode]; | 40 return kShelfSize[mode]; |
| 40 case SHELF_BUTTON_SPACING: | 41 case SHELF_BUTTON_SPACING: |
| 41 return kShelfButtonSpacing[mode]; | 42 return kShelfButtonSpacing[mode]; |
| 42 case SHELF_BUTTON_SIZE: | 43 case SHELF_BUTTON_SIZE: |
| 43 return kShelfButtonSize[mode]; | 44 return kShelfButtonSize[mode]; |
| 44 } | 45 } |
| 45 NOTREACHED(); | 46 NOTREACHED(); |
| 46 return 0; | 47 return 0; |
| 47 } | 48 } |
| 48 | 49 |
| 49 } // namespace ash | 50 } // namespace ash |
| OLD | NEW |