Chromium Code Reviews| Index: ash/shelf/shelf_constants.cc |
| diff --git a/ash/shelf/shelf_constants.cc b/ash/shelf/shelf_constants.cc |
| index dff9883617d42021b024cc6c7915a8942b077672..640de7957116cf3c09dd3fdf61aa9cd8b47a242e 100644 |
| --- a/ash/shelf/shelf_constants.cc |
| +++ b/ash/shelf/shelf_constants.cc |
| @@ -2,13 +2,36 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "ash/material_design/material_design_controller.h" |
| #include "ash/shelf/shelf_constants.h" |
| +#include "base/logging.h" |
| namespace ash { |
| const int kInvalidImageResourceID = -1; |
| -const int kShelfSize = 47; |
| -const int kShelfButtonSpacing = 10; |
| -const int kShelfButtonSize = 44; |
| +const int kWorkspaceAreaVisibleInset = 2; |
| +const int kWorkspaceAreaAutoHideInset = 5; |
| +const int kAutoHideSize = 3; |
| + |
| +int GetShelfLayoutConstant(ShelfLayoutConstant constant) { |
| + const int kShelfSize[] = {47, 48}; |
| + const int kShelfButtonSpacing[] = {10, 16}; |
| + const int kShelfButtonSize[] = {44, 48}; |
| + |
| + int mode = MaterialDesignController::Mode::NON_MATERIAL; |
|
bruthig
2016/05/25 20:24:52
Alternatively replace lines 21-23 using the ternar
yiyix
2016/06/02 03:54:53
Done.
|
| + if (MaterialDesignController::IsShelfMaterial()) |
| + mode = MaterialDesignController::Mode::MATERIAL_NORMAL; |
| + |
| + switch (constant) { |
| + case SHELF_SIZE: |
| + return kShelfSize[mode]; |
| + case SHELF_BUTTON_SPACING: |
| + return kShelfButtonSpacing[mode]; |
| + case SHELF_BUTTON_SIZE: |
| + return kShelfButtonSize[mode]; |
| + } |
| + NOTREACHED(); |
| + return 0; |
| +} |
| } // namespace ash |