Chromium Code Reviews| 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/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.
| |
| 5 #include "ash/shelf/shelf_constants.h" | 6 #include "ash/shelf/shelf_constants.h" |
| 7 #include "base/logging.h" | |
| 6 | 8 |
| 7 namespace ash { | 9 namespace ash { |
| 8 | 10 |
| 9 const int kInvalidImageResourceID = -1; | 11 const int kInvalidImageResourceID = -1; |
| 10 const int kShelfSize = 47; | 12 const int kWorkspaceAreaVisibleInset = 2; |
| 11 const int kShelfButtonSpacing = 10; | 13 const int kWorkspaceAreaAutoHideInset = 5; |
| 12 const int kShelfButtonSize = 44; | 14 const int kAutoHideSize = 3; |
| 15 const int kShelfItemInset = 3; | |
| 16 | |
| 17 int GetShelfLayoutConstant(ShelfLayoutConstant constant) { | |
| 18 const int kShelfSize[] = {47, 48}; | |
| 19 const int kShelfButtonSpacing[] = {10, 16}; | |
| 20 const int kShelfButtonSize[] = {44, 48}; | |
| 21 | |
| 22 int mode = MaterialDesignController::IsShelfMaterial() | |
| 23 ? MaterialDesignController::Mode::MATERIAL_NORMAL | |
| 24 : MaterialDesignController::Mode::NON_MATERIAL; | |
| 25 | |
| 26 switch (constant) { | |
| 27 case SHELF_SIZE: | |
| 28 return kShelfSize[mode]; | |
| 29 case SHELF_BUTTON_SPACING: | |
| 30 return kShelfButtonSpacing[mode]; | |
| 31 case SHELF_BUTTON_SIZE: | |
| 32 return kShelfButtonSize[mode]; | |
| 33 } | |
| 34 NOTREACHED(); | |
| 35 return 0; | |
| 36 } | |
| 13 | 37 |
| 14 } // namespace ash | 38 } // namespace ash |
| OLD | NEW |