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..6decc4386d0f79ae79d86141d2e8d64f2aaad216 100644 |
| --- a/ash/shelf/shelf_constants.cc |
| +++ b/ash/shelf/shelf_constants.cc |
| @@ -2,13 +2,37 @@ |
| // 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" |
|
tdanderson
2016/06/05 21:57:07
nit: the corresponding .h should always be first i
yiyix
2016/06/10 19:26:04
Done.
|
| #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; |
| +const int kShelfItemInset = 3; |
| + |
| +int GetShelfLayoutConstant(ShelfLayoutConstant constant) { |
| + const int kShelfSize[] = {47, 48}; |
| + const int kShelfButtonSpacing[] = {10, 16}; |
| + const int kShelfButtonSize[] = {44, 48}; |
| + |
| + int mode = MaterialDesignController::IsShelfMaterial() |
| + ? MaterialDesignController::Mode::MATERIAL_NORMAL |
| + : MaterialDesignController::Mode::NON_MATERIAL; |
| + |
| + 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 |