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" | |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
10 | 9 |
11 namespace ash { | 10 namespace ash { |
12 | 11 |
13 const int kTimeToSwitchBackgroundMs = 1000; | 12 const int kTimeToSwitchBackgroundMs = 1000; |
14 const int kWorkspaceAreaVisibleInset = 2; | 13 const int kWorkspaceAreaVisibleInset = 2; |
15 const int kWorkspaceAreaAutoHideInset = 5; | 14 const int kWorkspaceAreaAutoHideInset = 5; |
16 const int kShelfAutoHideSize = 3; | 15 const int kShelfAutoHideSize = 3; |
17 const int kShelfItemInset = 3; | 16 const int kShelfItemInset = 3; |
18 const SkColor kShelfBaseColor = SK_ColorBLACK; | 17 const SkColor kShelfBaseColor = SK_ColorBLACK; |
19 const SkColor kShelfButtonActivatedHighlightColor = | 18 const SkColor kShelfButtonActivatedHighlightColor = |
20 SkColorSetA(SK_ColorWHITE, 100); | 19 SkColorSetA(SK_ColorWHITE, 100); |
21 const SkColor kShelfInkDropBaseColor = SK_ColorWHITE; | 20 const SkColor kShelfInkDropBaseColor = SK_ColorWHITE; |
22 const float kShelfInkDropVisibleOpacity = 0.2f; | 21 const float kShelfInkDropVisibleOpacity = 0.2f; |
23 const SkColor kShelfIconColor = SK_ColorWHITE; | 22 const SkColor kShelfIconColor = SK_ColorWHITE; |
24 const int kShelfTranslucentAlpha = 153; | 23 const int kShelfTranslucentAlpha = 153; |
25 const int kOverflowButtonSize = 32; | 24 const int kOverflowButtonSize = 32; |
26 const int kOverflowButtonCornerRadius = 2; | 25 const int kOverflowButtonCornerRadius = 2; |
27 const int kAppListButtonRadius = kOverflowButtonSize / 2; | 26 const int kAppListButtonRadius = kOverflowButtonSize / 2; |
28 | 27 |
29 int GetShelfConstant(ShelfConstant shelf_constant) { | 28 int GetShelfConstant(ShelfConstant shelf_constant) { |
30 const int kShelfSize[] = {47, 48, 48}; | 29 const int kShelfSize[] = {47, 48, 48}; |
31 const int kShelfButtonSpacing[] = {10, 16, 16}; | 30 const int kShelfButtonSpacing[] = {10, 16, 16}; |
32 const int kShelfButtonSize[] = {44, 48, 48}; | 31 const int kShelfButtonSize[] = {44, 48, 48}; |
33 const int kShelfInsetsForAutoHide[] = {3, 0, 0}; | 32 const int kShelfInsetsForAutoHide[] = {3, 0, 0}; |
34 | 33 |
35 const int mode = MaterialDesignController::GetMode(); | 34 // fixme |
tdanderson
2017/02/13 17:36:28
nit: Please add TODO(estade) with brief descriptio
Evan Stade
2017/02/13 17:41:01
sorry, fixme is supposed to be a note to myself to
Evan Stade
2017/02/13 19:29:42
Done.
| |
36 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 35 const int mode = 1; |
37 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | |
38 | 36 |
39 switch (shelf_constant) { | 37 switch (shelf_constant) { |
40 case SHELF_SIZE: | 38 case SHELF_SIZE: |
41 return kShelfSize[mode]; | 39 return kShelfSize[mode]; |
42 case SHELF_BUTTON_SPACING: | 40 case SHELF_BUTTON_SPACING: |
43 return kShelfButtonSpacing[mode]; | 41 return kShelfButtonSpacing[mode]; |
44 case SHELF_BUTTON_SIZE: | 42 case SHELF_BUTTON_SIZE: |
45 return kShelfButtonSize[mode]; | 43 return kShelfButtonSize[mode]; |
46 case SHELF_INSETS_FOR_AUTO_HIDE: | 44 case SHELF_INSETS_FOR_AUTO_HIDE: |
47 return kShelfInsetsForAutoHide[mode]; | 45 return kShelfInsetsForAutoHide[mode]; |
48 } | 46 } |
49 NOTREACHED(); | 47 NOTREACHED(); |
50 return 0; | 48 return 0; |
51 } | 49 } |
52 | 50 |
53 } // namespace ash | 51 } // namespace ash |
OLD | NEW |