Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_provider.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" |
| 6 | 6 |
| 7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { | 7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { |
| 8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); | 8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); |
| 9 switch (metric) { | 9 switch (metric) { |
| 10 case views::INSETS_BUBBLE_CONTENTS: | 10 case views::INSETS_BUBBLE_CONTENTS: |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: | 64 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: |
| 65 return 0; | 65 return 0; |
| 66 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: | 66 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: |
| 67 return kHarmonyLayoutUnit; | 67 return kHarmonyLayoutUnit; |
| 68 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: | 68 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: |
| 69 return kHarmonyLayoutUnit; | 69 return kHarmonyLayoutUnit; |
| 70 case views::DISTANCE_UNRELATED_CONTROL_VERTICAL: | 70 case views::DISTANCE_UNRELATED_CONTROL_VERTICAL: |
| 71 return kHarmonyLayoutUnit; | 71 return kHarmonyLayoutUnit; |
| 72 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: | 72 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: |
| 73 return kHarmonyLayoutUnit; | 73 return kHarmonyLayoutUnit; |
| 74 case DISTANCE_TOAST_BUTTON_VERTICAL: | |
|
Peter Kasting
2017/07/13 04:52:47
I don't think you need to override any of these, s
ananta
2017/07/13 05:22:11
Not doing this caused the NOTREACHED() in the func
Peter Kasting
2017/07/13 05:31:37
Hmm. I'd say, remove the NOTREACHED and return 0,
ananta
2017/07/13 05:43:49
Thanks. Done
| |
| 75 return kHarmonyLayoutUnit / 2; | |
| 76 case DISTANCE_TOAST_TEXT_VERTICAL: | |
| 77 return kHarmonyLayoutUnit / 2 ; | |
| 78 case DISTANCE_TOAST_LABEL_VERTICAL: | |
| 79 return 12; | |
| 74 } | 80 } |
| 75 NOTREACHED(); | 81 NOTREACHED(); |
| 76 return 0; | 82 return 0; |
| 77 } | 83 } |
| 78 | 84 |
| 79 views::GridLayout::Alignment | 85 views::GridLayout::Alignment |
| 80 HarmonyLayoutProvider::GetControlLabelGridAlignment() const { | 86 HarmonyLayoutProvider::GetControlLabelGridAlignment() const { |
| 81 return views::GridLayout::LEADING; | 87 return views::GridLayout::LEADING; |
| 82 } | 88 } |
| 83 | 89 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 100 } | 106 } |
| 101 | 107 |
| 102 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * | 108 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * |
| 103 kHarmonyLayoutUnit; | 109 kHarmonyLayoutUnit; |
| 104 } | 110 } |
| 105 | 111 |
| 106 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() | 112 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() |
| 107 const { | 113 const { |
| 108 return typography_provider_; | 114 return typography_provider_; |
| 109 } | 115 } |
| OLD | NEW |