| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ = | 10 static base::LazyInstance<HarmonyLayoutDelegate>::DestructorAtExit |
| 11 LAZY_INSTANCE_INITIALIZER; | 11 harmony_layout_delegate_ = LAZY_INSTANCE_INITIALIZER; |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 HarmonyLayoutDelegate* HarmonyLayoutDelegate::Get() { | 14 HarmonyLayoutDelegate* HarmonyLayoutDelegate::Get() { |
| 15 return harmony_layout_delegate_.Pointer(); | 15 return harmony_layout_delegate_.Pointer(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 int HarmonyLayoutDelegate::GetMetric(Metric metric) const { | 18 int HarmonyLayoutDelegate::GetMetric(Metric metric) const { |
| 19 switch (metric) { | 19 switch (metric) { |
| 20 case Metric::BUTTON_HORIZONTAL_PADDING: | 20 case Metric::BUTTON_HORIZONTAL_PADDING: |
| 21 return kHarmonyLayoutUnit; | 21 return kHarmonyLayoutUnit; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 case DialogWidth::SMALL: | 75 case DialogWidth::SMALL: |
| 76 return 320; | 76 return 320; |
| 77 case DialogWidth::MEDIUM: | 77 case DialogWidth::MEDIUM: |
| 78 return 448; | 78 return 448; |
| 79 case DialogWidth::LARGE: | 79 case DialogWidth::LARGE: |
| 80 return 512; | 80 return 512; |
| 81 } | 81 } |
| 82 NOTREACHED(); | 82 NOTREACHED(); |
| 83 return 0; | 83 return 0; |
| 84 } | 84 } |
| OLD | NEW |