| 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> harmony_layout_delegate_ = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 return kHarmonyLayoutUnit; | 31 return kHarmonyLayoutUnit; |
| 32 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: | 32 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: |
| 33 return kHarmonyLayoutUnit; | 33 return kHarmonyLayoutUnit; |
| 34 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: | 34 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: |
| 35 return kHarmonyLayoutUnit; | 35 return kHarmonyLayoutUnit; |
| 36 } | 36 } |
| 37 NOTREACHED(); | 37 NOTREACHED(); |
| 38 return 0; | 38 return 0; |
| 39 } | 39 } |
| 40 | 40 |
| 41 views::GridLayout::Alignment |
| 42 HarmonyLayoutDelegate::GetControlLabelGridAlignment() const { |
| 43 return views::GridLayout::LEADING; |
| 44 } |
| 45 |
| 41 bool HarmonyLayoutDelegate::UseExtraDialogPadding() const { | 46 bool HarmonyLayoutDelegate::UseExtraDialogPadding() const { |
| 42 return false; | 47 return false; |
| 43 } | 48 } |
| 44 | 49 |
| 45 bool HarmonyLayoutDelegate::IsHarmonyMode() const { | 50 bool HarmonyLayoutDelegate::IsHarmonyMode() const { |
| 46 return true; | 51 return true; |
| 47 } | 52 } |
| 48 | 53 |
| 49 int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const { | 54 int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const { |
| 50 switch (type) { | 55 switch (type) { |
| 51 case DialogWidthType::SMALL: | 56 case DialogWidthType::SMALL: |
| 52 return 320; | 57 return 320; |
| 53 case DialogWidthType::MEDIUM: | 58 case DialogWidthType::MEDIUM: |
| 54 return 448; | 59 return 448; |
| 55 case DialogWidthType::LARGE: | 60 case DialogWidthType::LARGE: |
| 56 return 512; | 61 return 512; |
| 57 } | 62 } |
| 58 NOTREACHED(); | 63 NOTREACHED(); |
| 59 return 0; | 64 return 0; |
| 60 } | 65 } |
| OLD | NEW |